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

Comparing libev/ev.c (file contents):
Revision 1.13 by root, Wed Oct 31 10:50:05 2007 UTC vs.
Revision 1.14 by root, Wed Oct 31 11:52:12 2007 UTC

538 { 538 {
539 block = MAX_BLOCKTIME; 539 block = MAX_BLOCKTIME;
540 540
541 if (timercnt) 541 if (timercnt)
542 { 542 {
543 ev_tstamp to = timers [0]->at - get_clock () + method_fudge; 543 ev_tstamp to = timers [0]->at - (have_monotonic ? get_clock () : ev_now) + method_fudge;
544 if (block > to) block = to; 544 if (block > to) block = to;
545 } 545 }
546 546
547 if (periodiccnt) 547 if (periodiccnt)
548 { 548 {
677 { 677 {
678 timers [w->active - 1] = timers [timercnt]; 678 timers [w->active - 1] = timers [timercnt];
679 downheap ((WT *)timers, timercnt, w->active - 1); 679 downheap ((WT *)timers, timercnt, w->active - 1);
680 } 680 }
681 681
682 w->at = w->repeat;
683
682 ev_stop ((W)w); 684 ev_stop ((W)w);
685}
686
687void
688evtimer_again (struct ev_timer *w)
689{
690 if (ev_is_active (w))
691 {
692 if (w->repeat)
693 {
694 w->at = now + w->repeat;
695 downheap ((WT *)timers, timercnt, w->active - 1);
696 }
697 else
698 evtimer_stop (w);
699 }
700 else if (w->repeat)
701 evtimer_start (w);
683} 702}
684 703
685void 704void
686evperiodic_start (struct ev_periodic *w) 705evperiodic_start (struct ev_periodic *w)
687{ 706{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines