diff options
author | rpj <rpj> | 1998-07-28 05:17:18 +0000 |
---|---|---|
committer | rpj <rpj> | 1998-07-28 05:17:18 +0000 |
commit | 1f340918c533dfa73140cbc72a11a7bdc7acc5b9 (patch) | |
tree | d4eccc1f5847568a2a6b53c65f99f1fa8f8f42f8 | |
parent | 50096a2db46759c1a94647838ec84919af81584c (diff) |
Tue Jul 28 14:04:29 1998 Ross Johnson <rpj@swan.canberra.edu.au>
* exit.c (_pthread_exit): Add new pthread_t arg.
Rename _pthread_delete_thread_entry to _pthread_delete_thread.
Rename "us" to "thread".
(pthread_exit): Call _pthread_exit with added thread arg.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | exit.c | 14 |
2 files changed, 11 insertions, 8 deletions
@@ -1,5 +1,10 @@ Tue Jul 28 14:04:29 1998 Ross Johnson <rpj@swan.canberra.edu.au> + * exit.c (_pthread_exit): Add new pthread_t arg. + Rename _pthread_delete_thread_entry to _pthread_delete_thread. + Rename "us" to "thread". + (pthread_exit): Call _pthread_exit with added thread arg. + * create.c (_pthread_start_call): Insert missing ")". Add "us" arg to _pthread_exit() call. (pthread_create): Modify to use new thread allocation scheme. @@ -31,16 +31,14 @@ _pthread_vacuum(void) } void -_pthread_exit(void * value, int return_code) +_pthread_exit(pthread_t thread, void * value, int return_code) { - _pthread_threads_thread_t * us = _PTHREAD_THIS; - /* CRITICAL SECTION */ pthread_mutex_lock(&_pthread_table_mutex); /* Copy value into the thread entry so it can be given to any joining threads. */ - us->joinvalueptr = value; + thread->joinvalueptr = value; pthread_mutex_lock(&_pthread_table_mutex); /* END CRITICAL SECTION */ @@ -55,11 +53,11 @@ _pthread_exit(void * value, int return_code) be deleted by the last waiting pthread_join() after this thread has terminated. */ - if (pthread_attr_getdetachedstate(us, &detachstate) == 0 + if (pthread_attr_getdetachedstate(thread, &detachstate) == 0 && detachstate == PTHREAD_CREATE_DETACHED - && us->join_count == 0) + && thread->join_count == 0) { - _pthread_delete_thread_entry(us); + (void) _pthread_delete_thread(thread); } pthread_mutex_lock(&_pthread_table_mutex); @@ -71,5 +69,5 @@ _pthread_exit(void * value, int return_code) void pthread_exit(void * value) { - _pthread_exit(value, 0); + _pthread_exit(pthread_this(), value, 0); } |