aboutsummaryrefslogtreecommitdiff
path: root/malloc/thread-m.h
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/thread-m.h')
-rw-r--r--malloc/thread-m.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/malloc/thread-m.h b/malloc/thread-m.h
index d3352d1fe5..d65ba913b2 100644
--- a/malloc/thread-m.h
+++ b/malloc/thread-m.h
@@ -77,9 +77,14 @@ extern void *__dso_handle __attribute__ ((__weak__));
#include <fork.h>
-#define thread_atfork(prepare, parent, child) \
+#ifdef SHARED
+# define thread_atfork(prepare, parent, child) \
+ __register_atfork (prepare, parent, child, __dso_handle)
+#else
+# define thread_atfork(prepare, parent, child) \
__register_atfork (prepare, parent, child, \
&__dso_handle == NULL ? NULL : __dso_handle)
+#endif
#elif defined(MUTEX_INITIALIZER)
/* Assume hurd, with cthreads */