… | |
… | |
1237 | assert (("ev_periodic reschedule callback returned time in the past", ((WT)w)->at > ev_rt_now)); |
1237 | assert (("ev_periodic reschedule callback returned time in the past", ((WT)w)->at > ev_rt_now)); |
1238 | downheap ((WT *)periodics, periodiccnt, 0); |
1238 | downheap ((WT *)periodics, periodiccnt, 0); |
1239 | } |
1239 | } |
1240 | else if (w->interval) |
1240 | else if (w->interval) |
1241 | { |
1241 | { |
1242 | ((WT)w)->at = w->offset + floor ((ev_rt_now - w->offset) / w->interval + 1.) * w->interval; |
1242 | ((WT)w)->at = w->offset + (floor ((ev_rt_now - w->offset) / w->interval) + 1.) * w->interval; |
1243 | assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > ev_rt_now)); |
1243 | assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > ev_rt_now)); |
1244 | downheap ((WT *)periodics, periodiccnt, 0); |
1244 | downheap ((WT *)periodics, periodiccnt, 0); |
1245 | } |
1245 | } |
1246 | else |
1246 | else |
1247 | ev_periodic_stop (EV_A_ w); /* nonrepeating: stop timer */ |
1247 | ev_periodic_stop (EV_A_ w); /* nonrepeating: stop timer */ |