about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog7
-rw-r--r--nptl/pthread_create.c14
2 files changed, 16 insertions, 5 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 524d9b56bc..2182cac1cf 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-24  Ulrich Drepper  <drepper@redhat.com>
+
+	* pthread_create.c (start_thread): Don't wait for scheduler data
+	etc to be set at the beginning of the function.  The cancellation
+	infrastructure must have been set up.  And enable async
+	cancellation before potentially going to sleep.  [BZ #401]
+
 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
 
 	* Versions: Remove exports for pthread_set*id_np functions.
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 160656863d..14306867c9 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -227,11 +227,6 @@ start_thread (void *arg)
 
   struct pthread *pd = (struct pthread *) arg;
 
-  /* Get the lock the parent locked to force synchronization.  */
-  lll_lock (pd->lock);
-  /* And give it up right away.  */
-  lll_unlock (pd->lock);
-
 #if HP_TIMING_AVAIL
   /* Remember the time when the thread was started.  */
   hp_timing_t now;
@@ -257,6 +252,15 @@ start_thread (void *arg)
       /* Store the new cleanup handler info.  */
       THREAD_SETMEM (pd, cleanup_jmp_buf, &unwind_buf);
 
+      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);
+
+      CANCEL_RESET (oldtype);
+
       /* Run the code the user provided.  */
 #ifdef CALL_THREAD_FCT
       THREAD_SETMEM (pd, result, CALL_THREAD_FCT (pd));