summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpj <rpj>1999-08-13 16:17:01 +0000
committerrpj <rpj>1999-08-13 16:17:01 +0000
commitb1972e47c0359b818522f6aa822f3457be938060 (patch)
treea220b5937fe11341089082e732dfbd91fa8c24ed
parentd37b631a2d6ad1e86b39fac166229a02cd2c78bf (diff)
1999-08-14 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* exit.c (pthread_exit): Don't call pthread_self() but get thread handle directly for efficiency.
-rw-r--r--ChangeLog5
-rw-r--r--exit.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 76c866c..4655fc0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1999-08-14 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
+
+ * exit.c (pthread_exit): Don't call pthread_self() but
+ get thread handle directly for efficiency.
+
1999-08-12 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* private.c (_pthread_threadStart): ei[] only declared if _MSC_VER.
diff --git a/exit.c b/exit.c
index 5035718..18592a2 100644
--- a/exit.c
+++ b/exit.c
@@ -51,7 +51,7 @@ pthread_exit (void *value_ptr)
* ------------------------------------------------------
*/
{
- pthread_t self = pthread_self();
+ pthread_t self;
/* If the current thread is implicit it was not started through
pthread_create(), therefore we cleanup and end the thread
@@ -60,7 +60,9 @@ pthread_exit (void *value_ptr)
which will cleanup and end the thread for us.
*/
- if (self->implicit)
+ self = (pthread_t) pthread_getspecific (_pthread_selfThreadKey);
+
+ if (self == NULL || self->implicit)
{
_pthread_callUserDestroyRoutines(self);