summaryrefslogtreecommitdiff
path: root/nptl/pthread_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_create.c')
-rw-r--r--nptl/pthread_create.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 34cc37d527..1bab72d1e9 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -252,14 +252,17 @@ start_thread (void *arg)
/* Store the new cleanup handler info. */
THREAD_SETMEM (pd, cleanup_jmp_buf, &unwind_buf);
- int oldtype = CANCEL_ASYNC ();
+ if (__builtin_expect (pd->stopped_start, 0))
+ {
+ int oldtype = CANCEL_ASYNC ();
- /* Get the lock the parent locked to force synchronization. */
- lll_lock (pd->lock);
- /* And give it up right away. */
- lll_unlock (pd->lock);
+ /* Get the lock the parent locked to force synchronization. */
+ lll_lock (pd->lock);
+ /* And give it up right away. */
+ lll_unlock (pd->lock);
- CANCEL_RESET (oldtype);
+ CANCEL_RESET (oldtype);
+ }
/* Run the code the user provided. */
#ifdef CALL_THREAD_FCT