auto import from //depot/cupcake/@132589

This commit is contained in:
The Android Open Source Project
2009-03-03 14:03:51 -08:00
parent fe5745033a
commit a799b53f10
7 changed files with 92 additions and 319 deletions

View File

@@ -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 );