From 8114b95cef10a5a1fc3e529ab8b3a75f56fe889a Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Thu, 22 Sep 2022 15:27:20 +0100 Subject: Use C11 atomics instead of atomic_and/or Remove the 4 uses of atomic_and and atomic_or with atomic_fetch_and_acquire and atomic_fetch_or_acquire. This is preserves existing implied semantics, however relaxed MO on FUTEX_OWNER_DIED accesses may be correct. Passes regress on AArch64. Reviewed-by: Adhemerval Zanella --- nptl/pthread_mutex_lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nptl/pthread_mutex_lock.c') diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c index 6e767a8724..439b1e6391 100644 --- a/nptl/pthread_mutex_lock.c +++ b/nptl/pthread_mutex_lock.c @@ -462,7 +462,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex) if (__glibc_unlikely (oldval & FUTEX_OWNER_DIED)) { - atomic_and (&mutex->__data.__lock, ~FUTEX_OWNER_DIED); + atomic_fetch_and_acquire (&mutex->__data.__lock, ~FUTEX_OWNER_DIED); /* We got the mutex. */ mutex->__data.__count = 1; -- cgit 1.4.1