aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/pthread-timers.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-02-19 10:57:29 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-02-19 10:57:29 -0800
commit6f04a0f4c72acff80dad04828cb69ef67fa609d1 (patch)
tree915db7d93cb742f72b5d3819e69f48cb29c40a15 /libc/bionic/pthread-timers.c
parent2489551343aa89fc539f369f7689c941b78c08d1 (diff)
downloadandroid_bionic-6f04a0f4c72acff80dad04828cb69ef67fa609d1.tar.gz
android_bionic-6f04a0f4c72acff80dad04828cb69ef67fa609d1.tar.bz2
android_bionic-6f04a0f4c72acff80dad04828cb69ef67fa609d1.zip
auto import from //branches/cupcake/...@132276
Diffstat (limited to 'libc/bionic/pthread-timers.c')
-rw-r--r--libc/bionic/pthread-timers.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libc/bionic/pthread-timers.c b/libc/bionic/pthread-timers.c
index b8f748801..818b47dd8 100644
--- a/libc/bionic/pthread-timers.c
+++ b/libc/bionic/pthread-timers.c
@@ -469,7 +469,7 @@ timer_settime( timer_t id,
}
if ( __likely(!TIMER_ID_IS_WRAPPED(id)) ) {
- return __timer_gettime( id, ospec );
+ return __timer_settime( id, flags, spec, ospec );
} else {
thr_timer_t* timer = thr_timer_from_id(id);
struct timespec expires, now;
@@ -560,11 +560,11 @@ timer_thread_start( void* _arg )
if (timespec_cmp( &expires, &now ) > 0)
{
/* cool, there was no overrun, so compute the
- * relative timeout as 'now - expires', then wait
+ * relative timeout as 'expires - now', then wait
*/
int ret;
- struct timespec diff = now;
- timespec_sub( &diff, &expires );
+ struct timespec diff = expires;
+ timespec_sub( &diff, &now );
ret = __pthread_cond_timedwait_relative(
&timer->cond, &timer->mutex, &diff);