Merge "Properly detect timeout in pthread_mutex_lock_timeout_np_impl"

This commit is contained in:
Elliott Hughes 2013-12-18 17:56:22 +00:00 committed by Gerrit Code Review
commit 611b903ca7

View File

@ -783,7 +783,7 @@ int pthread_mutex_lock_timeout_np_impl(pthread_mutex_t *mutex, unsigned msecs)
* thread.
*/
if (MUTEX_STATE_BITS_IS_LOCKED_CONTENDED(mvalue)) {
if (__futex_wait_ex(&mutex->value, shared, mvalue, &ts) == ETIMEDOUT) {
if (__futex_wait_ex(&mutex->value, shared, mvalue, &ts) == (-ETIMEDOUT)) {
return EBUSY;
}
mvalue = mutex->value;