diff options
author | 2015-04-07 01:27:06 +0000 | |
---|---|---|
committer | 2015-04-07 01:27:06 +0000 | |
commit | 514a545f8a3983d53b7de4e8dfcefe16c9496776 (patch) | |
tree | e17cf0966466dfd49a1decf34dd536d3fdbe4765 /lib/libc/thread/unithread_malloc_lock.c | |
parent | Do not mistreat empty arguments to font alternating macros (diff) | |
download | wireguard-openbsd-514a545f8a3983d53b7de4e8dfcefe16c9496776.tar.xz wireguard-openbsd-514a545f8a3983d53b7de4e8dfcefe16c9496776.zip |
Make pthread_atfork() track the DSO that called it like atexit() does,
unregistering callbacks if the DSO is unloaded. Move the callback
handling from libpthread to libc, though libpthread still overrides the
inner call to handle locking and thread-library reinitialization.
Major version bump for both libc and libpthread.
verification that this fixes various ports ajacoutot@
asm assistance miod@; ok millert@ deraadt@
Diffstat (limited to 'lib/libc/thread/unithread_malloc_lock.c')
-rw-r--r-- | lib/libc/thread/unithread_malloc_lock.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/libc/thread/unithread_malloc_lock.c b/lib/libc/thread/unithread_malloc_lock.c index 920250139b8..d813bc708f2 100644 --- a/lib/libc/thread/unithread_malloc_lock.c +++ b/lib/libc/thread/unithread_malloc_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unithread_malloc_lock.c,v 1.8 2008/06/13 21:18:43 otto Exp $ */ +/* $OpenBSD: unithread_malloc_lock.c,v 1.9 2015/04/07 01:27:07 guenther Exp $ */ #include <sys/time.h> #include "thread_private.h" @@ -15,6 +15,12 @@ WEAK_PROTOTYPE(_thread_atexit_unlock); WEAK_ALIAS(_thread_atexit_lock); WEAK_ALIAS(_thread_atexit_unlock); +WEAK_PROTOTYPE(_thread_atfork_lock); +WEAK_PROTOTYPE(_thread_atfork_unlock); + +WEAK_ALIAS(_thread_atfork_lock); +WEAK_ALIAS(_thread_atfork_unlock); + WEAK_PROTOTYPE(_thread_arc4_lock); WEAK_PROTOTYPE(_thread_arc4_unlock); @@ -46,6 +52,18 @@ WEAK_NAME(_thread_atexit_unlock)(void) } void +WEAK_NAME(_thread_atfork_lock)(void) +{ + return; +} + +void +WEAK_NAME(_thread_atfork_unlock)(void) +{ + return; +} + +void WEAK_NAME(_thread_arc4_lock)(void) { return; |