From 9e69214f56cd5031f684da71a9eb24fa7003d1f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 7 Jun 2010 11:25:59 +0000 Subject: Merge OTP-8681 --- erts/emulator/sys/unix/sys.c | 4 ++++ erts/emulator/sys/win32/sys.c | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'erts/emulator/sys') diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index 50b208848f..151fa06e8e 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -457,6 +457,10 @@ thr_create_prepare_child(void *vtcdp) { erts_thr_create_data_t *tcdp = (erts_thr_create_data_t *) vtcdp; +#ifdef ERTS_ENABLE_LOCK_COUNT + erts_lcnt_thread_setup(); +#endif + #ifndef NO_FPE_SIGNALS /* * We do not want fp exeptions in other threads than the diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c index d3921a14f8..bd02cf85eb 100644 --- a/erts/emulator/sys/win32/sys.c +++ b/erts/emulator/sys/win32/sys.c @@ -2986,7 +2986,15 @@ static void ethr_internal_free(void *ptr) { erts_free(ERTS_ALC_T_ETHR_INTERNAL, ptr); } -#endif + +#ifdef ERTS_ENABLE_LOCK_COUNT +static void +thr_create_prepare_child(void *vtcdp) +{ + erts_lcnt_thread_setup(); +} +#endif /* ERTS_ENABLE_LOCK_COUNT */ +#endif /* USE_THREADS */ void erts_sys_pre_init(void) @@ -3000,6 +3008,11 @@ erts_sys_pre_init(void) eid.alloc = ethr_internal_alloc; eid.realloc = ethr_internal_realloc; eid.free = ethr_internal_free; + +#ifdef ERTS_ENABLE_LOCK_COUNT + eid.thread_create_child_func = thr_create_prepare_child; +#endif + erts_thr_init(&eid); #ifdef ERTS_ENABLE_LOCK_COUNT erts_lcnt_init(); -- cgit v1.2.3