diff options
Diffstat (limited to 'lib/libpthread/thread/thread_malloc_lock.c')
-rw-r--r-- | lib/libpthread/thread/thread_malloc_lock.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thread_malloc_lock.c b/lib/libpthread/thread/thread_malloc_lock.c index 8755b1dad27..6e8b96bb656 100644 --- a/lib/libpthread/thread/thread_malloc_lock.c +++ b/lib/libpthread/thread/thread_malloc_lock.c @@ -1,10 +1,11 @@ -/* $OpenBSD: thread_malloc_lock.c,v 1.4 2002/11/05 22:19:55 marc Exp $ */ +/* $OpenBSD: thread_malloc_lock.c,v 1.5 2006/02/22 07:16:32 otto Exp $ */ /* Public Domain <marc@snafu.org> */ #include <pthread.h> #include "pthread_private.h" static spinlock_t malloc_lock = _SPINLOCK_INITIALIZER; +static spinlock_t atexit_lock = _SPINLOCK_INITIALIZER; void _thread_malloc_lock() @@ -22,3 +23,15 @@ void _thread_malloc_init() { } + +void +_thread_atexit_lock() +{ + _SPINLOCK(&atexit_lock); +} + +void +_thread_atexit_unlock() +{ + _SPINUNLOCK(&atexit_lock); +} |