summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 14:03:51 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 14:03:51 -0800
commita799b53f10e5a6fd51fef4436cfb7ec99836a516 (patch)
tree9f06bfedddae069d0388739f5f2779472da5dc7f /libc
parentfe5745033a4f397c62a4e00efd9257ac9f83755c (diff)
downloadbionic-a799b53f10e5a6fd51fef4436cfb7ec99836a516.zip
bionic-a799b53f10e5a6fd51fef4436cfb7ec99836a516.tar.gz
bionic-a799b53f10e5a6fd51fef4436cfb7ec99836a516.tar.bz2
auto import from //depot/cupcake/@132589
Diffstat (limited to 'libc')
-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 );