Browse Source

*** empty log message ***

master
Marc Alexander Lehmann 13 years ago
parent
commit
c172f20f57
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      ev.c

+ 3
- 4
ev.c View File

@ -223,8 +223,7 @@ extern "C" {
* It is added to ev_rt_now when scheduling periodics
* to ensure progress, time-wise, even when rounding
* errors are against us.
* This value is good at least till the year 4000
* and intervals up to 20 years.
* This value is good at least till the year 4000.
* Better solutions welcome.
*/
#define TIME_EPSILON 0.0001220703125 /* 1/8192 */
@ -1250,7 +1249,8 @@ periodics_reify (EV_P)
}
else if (w->interval)
{
((WT)w)->at = w->offset + floor ((ev_rt_now + TIME_EPSILON - w->offset) / w->interval + 1.) * w->interval;
((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval;
if (((WT)w)->at - ev_rt_now <= TIME_EPSILON) ((WT)w)->at += w->interval;
assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > ev_rt_now));
downheap ((WT *)periodics, periodiccnt, 0);
}
@ -1373,7 +1373,6 @@ time_update (EV_P)
#if EV_PERIODIC_ENABLE
periodics_reschedule (EV_A);
#endif
/* adjust timers. this is easy, as the offset is the same for all of them */
for (i = 0; i < timercnt; ++i)
((WT)timers [i])->at += ev_rt_now - mn_now;


Loading…
Cancel
Save