aboutsummaryrefslogtreecommitdiff
path: root/nptl/pthread_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_create.c')
-rw-r--r--nptl/pthread_create.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 40a95c6f91..6ed5200e33 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -228,6 +228,9 @@ start_thread (void *arg)
pd->result = pd->start_routine (pd->arg);
}
+ /* The thread is exiting now. */
+ atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
+
/* Clean up any state libc stored in thread-local variables. */
__libc_thread_freeres ();
@@ -267,9 +270,6 @@ start_thread (void *arg)
}
- /* The thread is exiting now. */
- atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
-
/* If the thread is detached free the TCB. */
if (IS_DETACHED (pd))
/* Free the TCB. */