am 611b903c: Merge "Properly detect timeout in pthread_mutex_lock_timeout_np_impl"

* commit '611b903ca7ba9d604a9e2ebc1efa5a66f7ccc049':
  Properly detect timeout in pthread_mutex_lock_timeout_np_impl
This commit is contained in:
Elliott Hughes
2013-12-18 10:01:33 -08:00
committed by Android Git Automerger

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;