summaryrefslogtreecommitdiff
path: root/pthread/pt-exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'pthread/pt-exit.c')
-rw-r--r--pthread/pt-exit.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/pthread/pt-exit.c b/pthread/pt-exit.c
index 7484ffd1..5fe0ba86 100644
--- a/pthread/pt-exit.c
+++ b/pthread/pt-exit.c
@@ -28,7 +28,7 @@
/* Terminate the current thread and make STATUS available to any
- thread that might join us. */
+ thread that might join it. */
void
pthread_exit (void *status)
{
@@ -70,8 +70,6 @@ pthread_exit (void *status)
if (self->cancel_state == PTHREAD_CANCEL_ENABLE && self->cancel_pending)
status = PTHREAD_CANCELED;
- __pthread_thread_dealloc (self);
-
switch (self->state)
{
default:
@@ -86,7 +84,8 @@ pthread_exit (void *status)
deallocate our own stack. However, it will eventually be
reused when this thread structure is recycled. */
__pthread_mutex_unlock (&self->state_lock);
- need_dealloc = 1;
+
+ __pthread_dealloc (self);
break;
@@ -103,7 +102,6 @@ pthread_exit (void *status)
waiting to join us. */
pthread_cond_broadcast (&self->state_cond);
__pthread_mutex_unlock (&self->state_lock);
- need_dealloc = 0;
break;
}
@@ -113,7 +111,7 @@ pthread_exit (void *status)
This means that before freeing any resources, such a thread
should make sure that this thread is really halted. */
- __pthread_thread_halt (self, need_dealloc);
+ __pthread_thread_halt (self);
/* NOTREACHED */
abort ();