[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r8519 - in /trunk/libc: ChangeLog.eglibc nptl/nptl-init.c



Author: joseph
Date: Mon Jun  1 06:54:32 2009
New Revision: 8519

Log:
	* nptl/nptl-init.c: Restore local changes lost in upstream rename.

Modified:
    trunk/libc/ChangeLog.eglibc
    trunk/libc/nptl/nptl-init.c

Modified: trunk/libc/ChangeLog.eglibc
==============================================================================
--- trunk/libc/ChangeLog.eglibc (original)
+++ trunk/libc/ChangeLog.eglibc Mon Jun  1 06:54:32 2009
@@ -1,3 +1,7 @@
+2009-06-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* nptl/nptl-init.c: Restore local changes lost in upstream rename.
+
 2009-05-06  Aurelien Jarno  <aurelien@xxxxxxxxxxx>
 
 	* nss/nsswitch.c (lock_nsswitch, unlock_nsswitch): Remove brackets.

Modified: trunk/libc/nptl/nptl-init.c
==============================================================================
--- trunk/libc/nptl/nptl-init.c (original)
+++ trunk/libc/nptl/nptl-init.c Mon Jun  1 06:54:32 2009
@@ -245,12 +245,21 @@
 
   /* Reset the SETXID flag.  */
   struct pthread *self = THREAD_SELF;
-  int flags = THREAD_GETMEM (self, cancelhandling);
-  THREAD_SETMEM (self, cancelhandling, flags & ~SETXID_BITMASK);
+  int flags, newval;
+  do
+    {
+      flags = THREAD_GETMEM (self, cancelhandling);
+      newval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling,
+					  flags & ~SETXID_BITMASK, flags);
+    }
+  while (flags != newval);
 
   /* And release the futex.  */
   self->setxid_futex = 1;
   lll_futex_wake (&self->setxid_futex, 1, LLL_PRIVATE);
+
+  if (atomic_decrement_val (&__xidcmd->cntr) == 0)
+    lll_futex_wake (&__xidcmd->cntr, 1, LLL_PRIVATE);
 }