summaryrefslogtreecommitdiffstats
path: root/libc/bionic/pthread-timers.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/bionic/pthread-timers.c')
-rw-r--r--libc/bionic/pthread-timers.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/libc/bionic/pthread-timers.c b/libc/bionic/pthread-timers.c
index 7b9c99e..818b47d 100644
--- a/libc/bionic/pthread-timers.c
+++ b/libc/bionic/pthread-timers.c
@@ -485,19 +485,16 @@ timer_settime( timer_t id,
timer_gettime_internal(timer, ospec );
}
- /* compute next expiration time. note that if the
- * new it_interval is 0, we should disarm the timer
- */
+ /* compute next expiration time */
expires = spec->it_value;
- if (!timespec_is_zero(&expires)) {
- clock_gettime( timer->clock, &now );
- if (!(flags & TIMER_ABSTIME)) {
- timespec_add(&expires, &now);
- } else {
- if (timespec_cmp(&expires, &now) < 0)
- expires = now;
- }
+ clock_gettime( timer->clock, &now );
+ if (!(flags & TIMER_ABSTIME)) {
+ timespec_add(&expires, &now);
+ } else {
+ if (timespec_cmp(&expires, &now) < 0)
+ expires = now;
}
+
timer->expires = expires;
timer->period = spec->it_interval;
thr_timer_unlock( timer );