Browse Source

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

Eric Andersen 23 years ago
parent
commit
9a34fd5b88
1 changed files with 2 additions and 1 deletions
  1. 2 1
      libc/stdlib/atexit.c

+ 2 - 1
libc/stdlib/atexit.c

@@ -43,7 +43,7 @@
 
 
 #ifdef __UCLIBC_HAS_THREADS__
 #ifdef __UCLIBC_HAS_THREADS__
 #include <pthread.h>
 #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 LOCK	pthread_mutex_lock(&mylock)
 # define UNLOCK	pthread_mutex_unlock(&mylock);
 # define UNLOCK	pthread_mutex_unlock(&mylock);
 #else
 #else
@@ -168,6 +168,7 @@ void __exit_handler(int status)
 #ifdef L_exit
 #ifdef L_exit
 extern void weak_function _stdio_term(void);
 extern void weak_function _stdio_term(void);
 void (*__exit_cleanup) (int) = 0;
 void (*__exit_cleanup) (int) = 0;
+pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 
 
 /*
 /*
  * Normal program termination
  * Normal program termination