summaryrefslogtreecommitdiff
path: root/nptl/pthread_create.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2015-05-26 12:57:15 -0700
committerRoland McGrath <roland@hack.frob.com>2015-05-26 12:57:15 -0700
commit7be88c1bf860f4197e3ffac486515d6f1b38c666 (patch)
tree71b8316f4b2dd2ba296f9ddfd00fa2735e05dd95 /nptl/pthread_create.c
parent6afb9c0175006c8060928537842364f83df6fc15 (diff)
downloadglibc-roland/nacl-exit-stacks.tar.gz
Diffstat (limited to 'nptl/pthread_create.c')
-rw-r--r--nptl/pthread_create.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 71a56193e6..dcca1a5ab9 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -433,8 +433,10 @@ START_THREAD_DEFN
if (freesize > PTHREAD_STACK_MIN)
__madvise (pd->stackblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED);
+ const bool detached = IS_DETACHED (pd);
+
/* If the thread is detached free the TCB. */
- if (IS_DETACHED (pd))
+ if (detached)
/* Free the TCB. */
__free_tcb (pd);
else if (__glibc_unlikely (pd->cancelhandling & SETXID_BITMASK))
@@ -457,7 +459,7 @@ START_THREAD_DEFN
The exit code is zero since in case all threads exit by calling
'pthread_exit' the exit status must be 0 (zero). */
- __exit_thread ();
+ __exit_thread (detached);
/* NOTREACHED */
}