diff options
Diffstat (limited to 'exit.c')
-rw-r--r-- | exit.c | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -11,6 +11,47 @@ #include "pthread.h" #include "implement.h" +/* + * Code contributed by John E. Bossom <JEB>. + */ + +int +pthread_exit (void *value_ptr) + /* + * ------------------------------------------------------ + * DOCPUBLIC + * This function terminates the calling thread, returning + * the value 'value_ptr' to any joining thread. + * + * PARAMETERS + * value_ptr + * a generic data value (i.e. not the address of a value) + * + * + * DESCRIPTION + * This function terminates the calling thread, returning + * the value 'value_ptr' to any joining thread. + * NOTE: thread should be joinable. + * + * RESULTS + * N/A + * + * ------------------------------------------------------ + */ +{ + _pthread_callUserDestroyRoutines(pthread_getspecific(_pthread_selfThreadKey)); + + _endthreadex ((unsigned) value_ptr); + + return (0); + +} /* pthread_exit */ + +/* </JEB> */ + + +#if 0 /* Pre Bossom */ + void _pthread_vacuum(void) { @@ -72,3 +113,5 @@ pthread_exit(void * value) { _pthread_exit(pthread_self(), value, 0); } + +#endif /* Pre Bossom */ |