Remove code duplication for pthread_cond_timeout_np : use __pthread_cond_timedwait_relative helper
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c
index ec3c459..d2c81a3 100644
--- a/libc/bionic/pthread.c
+++ b/libc/bionic/pthread.c
@@ -1215,22 +1215,12 @@
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);
}