aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2010-06-07 11:25:59 +0000
committerErlang/OTP <[email protected]>2010-06-07 11:25:59 +0000
commit9e69214f56cd5031f684da71a9eb24fa7003d1f2 (patch)
tree26446f5d6db24fc8a7246a6d637de9226fb0b9a1 /erts/emulator/sys
parent8f243a67b6a710b076964a7043de7adc99bfa6d5 (diff)
downloadotp-9e69214f56cd5031f684da71a9eb24fa7003d1f2.tar.gz
otp-9e69214f56cd5031f684da71a9eb24fa7003d1f2.tar.bz2
otp-9e69214f56cd5031f684da71a9eb24fa7003d1f2.zip
Merge OTP-8681
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r--erts/emulator/sys/unix/sys.c4
-rw-r--r--erts/emulator/sys/win32/sys.c15
2 files changed, 18 insertions, 1 deletions
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();