about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nptl/pthread_mutex_lock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c
index 319658adc4..0fd7467b97 100644
--- a/nptl/pthread_mutex_lock.c
+++ b/nptl/pthread_mutex_lock.c
@@ -289,12 +289,12 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
 	     meantime.  */
 	  if ((oldval & FUTEX_WAITERS) == 0)
 	    {
-	      if (atomic_compare_and_exchange_bool_acq (&mutex->__data.__lock,
-							oldval | FUTEX_WAITERS,
-							oldval)
-		  != 0)
+	      int val;
+	      if ((val = atomic_compare_and_exchange_val_acq
+		   (&mutex->__data.__lock, oldval | FUTEX_WAITERS,
+		    oldval)) != oldval)
 		{
-		  oldval = mutex->__data.__lock;
+		  oldval = val;
 		  continue;
 		}
 	      oldval |= FUTEX_WAITERS;