Message ID | YelevLkTZU5Kb4Xi@gmail.com |
---|---|
State | Committed |
Commit | 6b8dbbd03ac88f169b65b5c7d7278576a11d2e44 |
Headers | show |
Series | [v4] nptl: Effectively skip CAS in spinlock loop | expand |
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
dj/TryBot-32bit | success | Build for i686 |
diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c index 31dfc7f1d7..d2e652d151 100644 --- a/nptl/pthread_mutex_lock.c +++ b/nptl/pthread_mutex_lock.c @@ -146,10 +146,9 @@ PTHREAD_MUTEX_LOCK (pthread_mutex_t *mutex) break; } atomic_spin_nop (); - if (LLL_MUTEX_READ_LOCK (mutex) != 0) - continue; } - while (LLL_MUTEX_TRYLOCK (mutex) != 0); + while (LLL_MUTEX_READ_LOCK (mutex) != 0 + || LLL_MUTEX_TRYLOCK (mutex) != 0); mutex->__data.__spins += (cnt - mutex->__data.__spins) / 8; }