diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | create.c | 3 | ||||
-rw-r--r-- | exit.c | 10 |
3 files changed, 17 insertions, 3 deletions
@@ -1,5 +1,12 @@ Sun Jul 26 13:06:12 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> + * exit.c (_pthread_exit): New function. Called from pthread_exit() + and _pthread_start_call() to exit the thread. It allows an extra + argument which is the return code passed to _endthreadex(). + + * create.c (_pthread_start_call): Change pthread_exit() call to + _pthread_exit() call. + * exit.c (_pthread_vacuum): Add thread entry deletion code moved from _pthread_start_call(). See next item. (pthread_exit): Remove longjmp(). Add mutex lock around thread table @@ -40,7 +40,8 @@ _pthread_start_call(void * us_arg) ret = (*func)(arg); - pthread_exit(NULL); + _pthread_exit(NULL, ret); + /* Never Reached */ } @@ -46,7 +46,7 @@ _pthread_vacuum(void) } void -pthread_exit(void * value) +_pthread_exit(void * value, int return_code) { _pthread_threads_thread_t * us = _PTHREAD_THIS; @@ -62,5 +62,11 @@ pthread_exit(void * value) _pthread_vacuum(); - _endthreadex(0); + _endthreadex(return_code); +} + +void +pthread_exit(void * value) +{ + _pthread_exit(value, 0); } |