OSDN Git Service
(root)
/
android-x86
/
bionic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3377165
)
Properly detect timeout in pthread_mutex_lock_timeout_np_impl
author
Ken Mixter
<kmixter@google.com>
Tue, 17 Dec 2013 20:40:08 +0000
(12:40 -0800)
committer
Ken Mixter
<kmixter@google.com>
Tue, 17 Dec 2013 22:26:01 +0000
(14:26 -0800)
Previously we were checking against a positive errno which
would not be returned from a system call.
Change-Id: I8e3a36f6fbf5ccc2191a152a1def37e2d6f93124
libc/bionic/pthread_mutex.cpp
patch
|
blob
|
history
diff --git
a/libc/bionic/pthread_mutex.cpp
b/libc/bionic/pthread_mutex.cpp
index
1010f11
..
4a11747
100644
(file)
--- a/
libc/bionic/pthread_mutex.cpp
+++ b/
libc/bionic/pthread_mutex.cpp
@@
-800,7
+800,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;