summaryrefslogtreecommitdiff
path: root/pthread/pt-join.c
diff options
context:
space:
mode:
Diffstat (limited to 'pthread/pt-join.c')
-rw-r--r--pthread/pt-join.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pthread/pt-join.c b/pthread/pt-join.c
index 8bd2c6c..417f433 100644
--- a/pthread/pt-join.c
+++ b/pthread/pt-join.c
@@ -64,9 +64,11 @@ pthread_join (pthread_t thread, void **status)
/* Destroy the stack, the kernel resources and the control
block. */
- assert (pthread->stack);
- __pthread_stack_dealloc (pthread->stackaddr, pthread->stacksize);
- pthread->stack = 0;
+ if (pthread->stack)
+ {
+ __pthread_stack_dealloc (pthread->stackaddr, pthread->stacksize);
+ pthread->stack = 0;
+ }
__pthread_thread_dealloc (pthread);