summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/pthread/malloc-machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/sysdeps/pthread/malloc-machine.h')
-rw-r--r--libpthread/nptl/sysdeps/pthread/malloc-machine.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/libpthread/nptl/sysdeps/pthread/malloc-machine.h b/libpthread/nptl/sysdeps/pthread/malloc-machine.h
index efab230aa..e99aaa781 100644
--- a/libpthread/nptl/sysdeps/pthread/malloc-machine.h
+++ b/libpthread/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, 2008 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 */
@@ -52,10 +63,10 @@ extern void *__dso_handle __attribute__ ((__weak__));
#include <bits/libc-tsd.h>
typedef int tsd_key_t[1]; /* no key data structure, libc magic does it */
-__libc_tsd_define (static, MALLOC) /* declaration/common definition */
+__libc_tsd_define (static, void *, MALLOC) /* declaration/common definition */
#define tsd_key_create(key, destr) ((void) (key))
-#define tsd_setspecific(key, data) __libc_tsd_set (MALLOC, (data))
-#define tsd_getspecific(key, vptr) ((vptr) = __libc_tsd_get (MALLOC))
+#define tsd_setspecific(key, data) __libc_tsd_set (void *, MALLOC, (data))
+#define tsd_getspecific(key, vptr) ((vptr) = __libc_tsd_get (void *, MALLOC))
#include <sysdeps/generic/malloc-machine.h>