aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/pthread_mutex.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-12-18 17:56:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-12-18 17:56:22 +0000
commit611b903ca7ba9d604a9e2ebc1efa5a66f7ccc049 (patch)
treeaacd4f90033fe14a9689caace700b9ed19af0a6b /libc/bionic/pthread_mutex.cpp
parente00f4890c71e9c9eb715faf2c7443732b2fdfae3 (diff)
parent4fae14f3335375714be3104742fa69fe65b02001 (diff)
downloadandroid_bionic-611b903ca7ba9d604a9e2ebc1efa5a66f7ccc049.tar.gz
android_bionic-611b903ca7ba9d604a9e2ebc1efa5a66f7ccc049.tar.bz2
android_bionic-611b903ca7ba9d604a9e2ebc1efa5a66f7ccc049.zip
Merge "Properly detect timeout in pthread_mutex_lock_timeout_np_impl"
Diffstat (limited to 'libc/bionic/pthread_mutex.cpp')
-rw-r--r--libc/bionic/pthread_mutex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/bionic/pthread_mutex.cpp b/libc/bionic/pthread_mutex.cpp
index 8eaf95fc3..11a66ab88 100644
--- a/libc/bionic/pthread_mutex.cpp
+++ b/libc/bionic/pthread_mutex.cpp
@@ -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;