Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 25 Sep 2004 07:44:41 +0000 (07:44 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 25 Sep 2004 07:44:41 +0000 (07:44 +0000)
2004-09-25  Jakub Jelinek  <jakub@redhat.com>

* sysdeps/unix/sysv/linux/i386/setuid.c (__setuid): Remove second
result declaration.

2004-09-22  Andreas Schwab  <schwab@suse.de>

* sysdeps/unix/sysv/linux/ia64/sysdep.h: Adjust whitespace.

ChangeLog
nptl/ChangeLog
nptl/descr.h
nptl/pthread_create.c
nptl/sysdeps/pthread/createthread.c
sysdeps/unix/sysv/linux/i386/setuid.c
sysdeps/unix/sysv/linux/ia64/sysdep.h

index 30772a9..9d835e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-09-25  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/unix/sysv/linux/i386/setuid.c (__setuid): Remove second
+       result declaration.
+
+2004-09-22  Andreas Schwab  <schwab@suse.de>
+
+       * sysdeps/unix/sysv/linux/ia64/sysdep.h: Adjust whitespace.
+
 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
 
        * misc/daemon.c (daemon): Don't succeed if /dev/null cannot be
index 01c6c10..157b793 100644 (file)
@@ -1,3 +1,11 @@
+2004-09-25  Ulrich Drepper  <drepper@redhat.com>
+
+       * descr.h (struct pthread): Add stopped_start field.
+       * sysdeps/pthread/createthread.c (create_thread): Set
+       start_stopped flag in descriptor for new thread appropriately.
+       * pthread_create.c (start_thread): Only take lock to be stopped on
+       startup if stopped_start flag says so.
+
 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
 
        * pthread_create.c (__pthread_create_2_1): Remember whether thread
index 0f8d347..d813929 100644 (file)
@@ -197,6 +197,9 @@ struct pthread
   /* True if the user provided the stack.  */
   bool user_stack;
 
+  /* True if thread must stop at startup time.  */
+  bool stopped_start;
+
   /* Lock to synchronize access to the descriptor.  */
   lll_lock_t lock;
 
index 34cc37d..1bab72d 100644 (file)
@@ -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
index fb8d8ce..8620519 100644 (file)
@@ -186,6 +186,9 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
       if ((_mask & (__nptl_threads_events.event_bits[_idx]
                    | pd->eventbuf.eventmask.event_bits[_idx])) != 0)
        {
+         /* We always must have the thread start stopped.  */
+         pd->stopped_start = true;
+
          /* Create the thread.  We always create the thread stopped
             so that it does not get far before we tell the debugger.  */
          int res = do_clone (pd, attr, clone_flags, start_thread,
@@ -224,10 +227,11 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
   /* Determine whether the newly created threads has to be started
      stopped since we have to set the scheduling parameters or set the
      affinity.  */
-  int stopped = 0;
+  bool stopped = false;
   if (attr != NULL && (attr->cpuset != NULL
                       || (attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0))
-    stopped = 1;
+    stopped = true;
+  pd->stopped_start = stopped;
 
   /* Actually create the thread.  */
   int res = do_clone (pd, attr, clone_flags, start_thread,
index a11fb7f..0d948fb 100644 (file)
@@ -47,7 +47,6 @@ __setuid (uid_t uid)
 # ifdef __NR_setuid32
   if (__libc_missing_32bit_uids <= 0)
     {
-      int result;
       int saved_errno = errno;
 
       result = INLINE_SYSCALL (setuid32, 1, uid);
index 0347641..a4453dd 100644 (file)
 
 #undef PSEUDO_ERRVAL
 #define        PSEUDO_ERRVAL(name, syscall_name, args) \
-  ENTRY(name)                                          \
+  ENTRY(name)                                  \
     DO_CALL (SYS_ify(syscall_name));           \
        cmp.eq p6,p0=-1,r10;                    \
 (p6)   mov r10=r8;
   DO_INLINE_SYSCALL_NCS (__NR_##name, nr, ##args)
 
 #undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...)      \
-  ({                                           \
-    DO_INLINE_SYSCALL_NCS(__NR_##name, nr, args)\
-    if (_r10 == -1)                            \
-      {                                                \
-       __set_errno (_retval);                  \
-       _retval = -1;                           \
-      }                                                \
+#define INLINE_SYSCALL(name, nr, args...)              \
+  ({                                                   \
+    DO_INLINE_SYSCALL_NCS (__NR_##name, nr, args)      \
+    if (_r10 == -1)                                    \
+      {                                                        \
+       __set_errno (_retval);                          \
+       _retval = -1;                                   \
+      }                                                        \
     _retval; })
 
 #undef INTERNAL_SYSCALL_DECL
 #undef INTERNAL_SYSCALL
 #define INTERNAL_SYSCALL_NCS(name, err, nr, args...)   \
   ({                                                   \
-    DO_INLINE_SYSCALL_NCS(name, nr, args)              \
+    DO_INLINE_SYSCALL_NCS (name, nr, args)             \
     err = _r10;                                                \
     _retval; })
 #define INTERNAL_SYSCALL(name, err, nr, args...)       \