… | |
… | |
794 | { |
794 | { |
795 | while (timercnt && timers [0]->at <= mn_now) |
795 | while (timercnt && timers [0]->at <= mn_now) |
796 | { |
796 | { |
797 | struct ev_timer *w = timers [0]; |
797 | struct ev_timer *w = timers [0]; |
798 | |
798 | |
|
|
799 | assert (("inactive timer on timer heap detected", ev_is_active (w))); |
|
|
800 | |
799 | /* first reschedule or stop timer */ |
801 | /* first reschedule or stop timer */ |
800 | if (w->repeat) |
802 | if (w->repeat) |
801 | { |
803 | { |
802 | assert (("negative ev_timer repeat value found while processing timers", w->repeat > 0.)); |
804 | assert (("negative ev_timer repeat value found while processing timers", w->repeat > 0.)); |
803 | w->at = mn_now + w->repeat; |
805 | w->at = mn_now + w->repeat; |
… | |
… | |
815 | { |
817 | { |
816 | while (periodiccnt && periodics [0]->at <= rt_now) |
818 | while (periodiccnt && periodics [0]->at <= rt_now) |
817 | { |
819 | { |
818 | struct ev_periodic *w = periodics [0]; |
820 | struct ev_periodic *w = periodics [0]; |
819 | |
821 | |
|
|
822 | assert (("inactive timer on periodic heap detected", ev_is_active (w))); |
|
|
823 | |
820 | /* first reschedule or stop timer */ |
824 | /* first reschedule or stop timer */ |
821 | if (w->interval) |
825 | if (w->interval) |
822 | { |
826 | { |
823 | w->at += floor ((rt_now - w->at) / w->interval + 1.) * w->interval; |
827 | w->at += floor ((rt_now - w->at) / w->interval + 1.) * w->interval; |
824 | assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", w->at > rt_now)); |
828 | assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", w->at > rt_now)); |