make timers best-effort non-drifting

This commit is contained in:
Marc Alexander Lehmann 2007-11-11 00:05:59 +00:00
parent b07765847b
commit c2f091b5fa
1 changed files with 5 additions and 1 deletions

6
ev.c
View File

@ -989,7 +989,11 @@ timers_reify (EV_P)
if (w->repeat)
{
assert (("negative ev_timer repeat value found while processing timers", w->repeat > 0.));
((WT)w)->at = mn_now + w->repeat;
((WT)w)->at += w->repeat;
if (((WT)w)->at < mn_now)
((WT)w)->at = mn_now;
downheap ((WT *)timers, timercnt, 0);
}
else