1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Don't do lock elision on an error checking mutex (bug 17514)

Error checking mutexes are not supposed to be subject to lock elision.
That would defeat the error checking nature of the mutex because lock
elision doesn't record ownership.
This commit is contained in:
Andreas Schwab
2016-01-13 16:04:42 +01:00
parent 9200e581e5
commit 5aded6f2ab
4 changed files with 76 additions and 4 deletions

View File

@ -89,7 +89,8 @@ pthread_mutex_timedlock (pthread_mutex_t *mutex,
if (__glibc_unlikely (mutex->__data.__owner == id))
return EDEADLK;
/* FALLTHROUGH */
/* Don't do lock elision on an error checking mutex. */
goto simple;
case PTHREAD_MUTEX_TIMED_NP:
FORCE_ELISION (mutex, goto elision);