ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.245 by root, Wed May 21 00:26:01 2008 UTC vs.
Revision 1.246 by root, Wed May 21 12:51:38 2008 UTC

1649 downheap (periodics, periodiccnt, HEAP0); 1649 downheap (periodics, periodiccnt, HEAP0);
1650 } 1650 }
1651 else if (w->interval) 1651 else if (w->interval)
1652 { 1652 {
1653 ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; 1653 ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval;
1654 /* if next trigger time is not sufficiently in the future, put it there */
1655 /* this might happen because of floating point inexactness */
1654 if (ev_at (w) - ev_rt_now <= TIME_EPSILON) ev_at (w) += w->interval; 1656 if (ev_at (w) - ev_rt_now < TIME_EPSILON)
1657 {
1658 ev_at (w) += w->interval;
1655 1659
1656 assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ev_at (w) >= ev_rt_now)); 1660 /* if interval is unreasonably low we might still have a time in the past */
1661 /* so correct this. this will make the periodic very inexact, but the user */
1662 /* has effectively asked to get triggered more often than possible */
1663 if (ev_at (w) < ev_rt_now)
1664 ev_at (w) = ev_rt_now;
1665 }
1657 1666
1658 ANHE_at_set (periodics [HEAP0]); 1667 ANHE_at_set (periodics [HEAP0]);
1659 downheap (periodics, periodiccnt, HEAP0); 1668 downheap (periodics, periodiccnt, HEAP0);
1660 } 1669 }
1661 else 1670 else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines