summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-08-12 04:15:45 +0000
committerEric Andersen <andersen@codepoet.org>2002-08-12 04:15:45 +0000
commit9a34fd5b8807487a89bb9dd4e895f1f448d75e94 (patch)
treee21624af6803f2448ad61983583c28631f9d128c
parentfd19822e4d58682ee95816c9e2f46094e4052edd (diff)
Geez I'm an idiot some times. I shouldn't code when I'm exhausted.
I _totally_ screwed up the locking on exit and atexit such that it didn't do any good at all. -Erik
-rw-r--r--libc/stdlib/atexit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c
index d3632c276..a877c5a1f 100644
--- a/libc/stdlib/atexit.c
+++ b/libc/stdlib/atexit.c
@@ -43,7 +43,7 @@
#ifdef __UCLIBC_HAS_THREADS__
#include <pthread.h>
-static pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+extern pthread_mutex_t mylock;
# define LOCK pthread_mutex_lock(&mylock)
# define UNLOCK pthread_mutex_unlock(&mylock);
#else
@@ -168,6 +168,7 @@ void __exit_handler(int status)
#ifdef L_exit
extern void weak_function _stdio_term(void);
void (*__exit_cleanup) (int) = 0;
+pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
/*
* Normal program termination