summaryrefslogtreecommitdiffstats
path: root/libc/bionic/pthread.c
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-09-16 16:21:35 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-09-16 16:21:35 -0700
commit895244b2ab91b34ab03efc78417ee1eb73f3e7ba (patch)
tree3804d2df015633253f48beaaf268eb10f02a2543 /libc/bionic/pthread.c
parentb8a18d059b8bde9a04e5778a0074a54413328472 (diff)
parenta246a71975c1b4a939421ed20fdd8557f93de46f (diff)
downloadbionic-895244b2ab91b34ab03efc78417ee1eb73f3e7ba.zip
bionic-895244b2ab91b34ab03efc78417ee1eb73f3e7ba.tar.gz
bionic-895244b2ab91b34ab03efc78417ee1eb73f3e7ba.tar.bz2
merge from open-source master
Diffstat (limited to 'libc/bionic/pthread.c')
-rw-r--r--libc/bionic/pthread.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c
index d8a3166..26e27ce 100644
--- a/libc/bionic/pthread.c
+++ b/libc/bionic/pthread.c
@@ -1241,22 +1241,12 @@ int pthread_cond_timeout_np(pthread_cond_t *cond,
pthread_mutex_t * mutex,
unsigned msecs)
{
- int oldvalue;
struct timespec ts;
- int status;
ts.tv_sec = msecs / 1000;
ts.tv_nsec = (msecs % 1000) * 1000000;
- oldvalue = cond->value;
-
- pthread_mutex_unlock(mutex);
- status = __futex_wait(&cond->value, oldvalue, &ts);
- pthread_mutex_lock(mutex);
-
- if(status == (-ETIMEDOUT)) return ETIMEDOUT;
-
- return 0;
+ return __pthread_cond_timedwait_relative(cond, mutex, &ts);
}