diff options
Diffstat (limited to 'libc/bionic/pthread-timers.c')
-rw-r--r-- | libc/bionic/pthread-timers.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libc/bionic/pthread-timers.c b/libc/bionic/pthread-timers.c index b8f7488..818b47d 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); |