summaryrefslogtreecommitdiff
path: root/exit.c
diff options
context:
space:
mode:
authorrpj <rpj>1998-07-28 05:17:18 +0000
committerrpj <rpj>1998-07-28 05:17:18 +0000
commit1f340918c533dfa73140cbc72a11a7bdc7acc5b9 (patch)
treed4eccc1f5847568a2a6b53c65f99f1fa8f8f42f8 /exit.c
parent50096a2db46759c1a94647838ec84919af81584c (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.
Diffstat (limited to 'exit.c')
-rw-r--r--exit.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/exit.c b/exit.c
index 4d0f42c..e74c843 100644
--- a/exit.c
+++ b/exit.c
@@ -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);
}