about summary refs log tree commit diff
path: root/nptl/pthread_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_create.c')
-rw-r--r--nptl/pthread_create.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 58116f7925..519d0c6f60 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -227,9 +227,6 @@ start_thread (void *arg)
       THREAD_SETMEM (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 ();
 
@@ -268,6 +265,10 @@ start_thread (void *arg)
 	}
     }
 
+  /* The thread is exiting now.  Don't set this bit until after we've hit
+     the event-reporting breakpoint, so that td_thr_get_info on us while at
+     the breakpoint reports TD_THR_RUN state rather than TD_THR_ZOMBIE.  */
+  atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
 
   /* If the thread is detached free the TCB.  */
   if (IS_DETACHED (pd))