summaryrefslogtreecommitdiff
path: root/nptl/pthread_mutex_trylock.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-05-21 20:01:15 +0000
committerJakub Jelinek <jakub@redhat.com>2007-05-21 20:01:15 +0000
commit75831cc48d3fef9b0bb247aabbcdaceef85efa23 (patch)
tree49952b4916fa5d21f944970fa0ff5392742e9378 /nptl/pthread_mutex_trylock.c
parent473e6b3f8fcf9c937d5a85da70b95f5c13f4a28f (diff)
Backported selected fixes from 2007-05-{17,18,21}.cvs/fedora-glibc-2_6-2
Diffstat (limited to 'nptl/pthread_mutex_trylock.c')
-rw-r--r--nptl/pthread_mutex_trylock.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c
index 4990ecd711..9db904c60b 100644
--- a/nptl/pthread_mutex_trylock.c
+++ b/nptl/pthread_mutex_trylock.c
@@ -84,9 +84,11 @@ __pthread_mutex_trylock (mutex)
if ((oldval & FUTEX_OWNER_DIED) != 0)
{
/* The previous owner died. Try locking the mutex. */
- int newval
+ int newval = id | (oldval & FUTEX_WAITERS);
+
+ newval
= atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
- id, oldval);
+ newval, oldval);
if (newval != oldval)
{