Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 24 Sep 2004 07:18:48 +0000 (07:18 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 24 Sep 2004 07:18:48 +0000 (07:18 +0000)
2004-09-23  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

* sysdeps/unix/sysv/linux/sh/sysdep.h (INTERNAL_SYSCALL_NCS): Define.

ChangeLog
nptl/ChangeLog
nptl/pthread_create.c
sysdeps/unix/sysv/linux/sh/sysdep.h

index f86d8bc..618f504 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-09-23  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * sysdeps/unix/sysv/linux/sh/sysdep.h (INTERNAL_SYSCALL_NCS): Define.
+
 2004-09-23  Thorsten Kukuk  <kukuk@suse.de>
 
        * sysdeps/unix/sysv/linux/sys/mount.h: Sync MS_RMT_MASK flag
index 524d9b5..2182cac 100644 (file)
@@ -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.
index 1606568..1430686 100644 (file)
@@ -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));
index 35b8a58..aeec279 100644 (file)
                                                                              \
     (int) resultvar; })
 
+/* The _NCS variant allows non-constant syscall numbers.  */
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+  ({                                                                         \
+    unsigned long int resultvar;                                             \
+    register long int r3 asm ("%r3") = (name);                               \
+    SUBSTITUTE_ARGS_##nr(args);                                                      \
+                                                                             \
+    asm volatile (SYSCALL_INST_STR##nr SYSCALL_INST_PAD                              \
+                 : "=z" (resultvar)                                          \
+                 : "r" (r3) ASMFMT_##nr                                      \
+                 : "memory");                                                \
+                                                                             \
+    (int) resultvar; })
+
 #undef INTERNAL_SYSCALL_DECL
 #define INTERNAL_SYSCALL_DECL(err) do { } while (0)