summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--exit.c14
2 files changed, 11 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index d3f7141..1054549 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
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);
}