about summary refs log tree commit diff
path: root/nptl/sysdeps/pthread/malloc-machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/pthread/malloc-machine.h')
-rw-r--r--nptl/sysdeps/pthread/malloc-machine.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/nptl/sysdeps/pthread/malloc-machine.h b/nptl/sysdeps/pthread/malloc-machine.h
index efab230aa8..33a3d20531 100644
--- a/nptl/sysdeps/pthread/malloc-machine.h
+++ b/nptl/sysdeps/pthread/malloc-machine.h
@@ -1,6 +1,6 @@
 /* Basic platform-independent macro definitions for mutexes,
    thread-specific data and parameters for malloc.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -38,13 +38,24 @@ extern void *__dso_handle __attribute__ ((__weak__));
 
 #include <fork.h>
 
+#define ATFORK_MEM static struct fork_handler atfork_mem
+
 #ifdef SHARED
 # define thread_atfork(prepare, parent, child) \
-   __register_atfork (prepare, parent, child, __dso_handle)
+  atfork_mem.prepare_handler = prepare;					      \
+  atfork_mem.parent_handler = parent;					      \
+  atfork_mem.child_handler = child;					      \
+  atfork_mem.dso_handle = __dso_handle;					      \
+  atfork_mem.refcntr = 1;						      \
+  __linkin_atfork (&atfork_mem)
 #else
 # define thread_atfork(prepare, parent, child) \
-   __register_atfork (prepare, parent, child,				      \
-		      &__dso_handle == NULL ? NULL : __dso_handle)
+  atfork_mem.prepare_handler = prepare;					      \
+  atfork_mem.parent_handler = parent;					      \
+  atfork_mem.child_handler = child;					      \
+  atfork_mem.dso_handle = &__dso_handle == NULL ? NULL : __dso_handle;	      \
+  atfork_mem.refcntr = 1;						      \
+  __linkin_atfork (&atfork_mem)
 #endif
 
 /* thread specific data for glibc */