diff options
author | Andreas Schwab <schwab@suse.de> | 2016-01-13 16:04:42 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2016-01-25 16:26:07 +0100 |
commit | 5aded6f2abbe19bc77e563b7db10aa9dd037a90d (patch) | |
tree | c0ef8f09db876a88ea8c29e29c6655d1c50f4f7d /nptl/pthread_mutex_timedlock.c | |
parent | 9200e581e500b6c8ad52733f9c0ac3efc8d4b4b9 (diff) | |
download | glibc-5aded6f2abbe19bc77e563b7db10aa9dd037a90d.tar.gz glibc-5aded6f2abbe19bc77e563b7db10aa9dd037a90d.tar.xz glibc-5aded6f2abbe19bc77e563b7db10aa9dd037a90d.zip |
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.
Diffstat (limited to 'nptl/pthread_mutex_timedlock.c')
-rw-r--r-- | nptl/pthread_mutex_timedlock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c index 9055e11f8f..07f0901e52 100644 --- a/nptl/pthread_mutex_timedlock.c +++ b/nptl/pthread_mutex_timedlock.c @@ -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); |