summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/ChangeLog.eglibc4
-rw-r--r--libc/nptl/nptl-init.c13
2 files changed, 15 insertions, 2 deletions
diff --git a/libc/ChangeLog.eglibc b/libc/ChangeLog.eglibc
index fe5da37d2..2042cacbf 100644
--- a/libc/ChangeLog.eglibc
+++ b/libc/ChangeLog.eglibc
@@ -1,3 +1,7 @@
+2009-06-01 Joseph Myers <joseph@codesourcery.com>
+
+ * nptl/nptl-init.c: Restore local changes lost in upstream rename.
+
2009-05-06 Aurelien Jarno <aurelien@aurel32.net>
* nss/nsswitch.c (lock_nsswitch, unlock_nsswitch): Remove brackets.
diff --git a/libc/nptl/nptl-init.c b/libc/nptl/nptl-init.c
index 5e9c250ff..0449ec077 100644
--- a/libc/nptl/nptl-init.c
+++ b/libc/nptl/nptl-init.c
@@ -245,12 +245,21 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
/* 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);
}