From 75831cc48d3fef9b0bb247aabbcdaceef85efa23 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 21 May 2007 20:01:15 +0000 Subject: Backported selected fixes from 2007-05-{17,18,21}. --- nptl/pthread_mutex_trylock.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nptl/pthread_mutex_trylock.c') 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) { -- cgit v1.2.3