*** empty log message ***

This commit is contained in:
Marc Alexander Lehmann 2007-10-31 11:52:12 +00:00
parent 4efcdb6b58
commit ef1150cb72
2 changed files with 21 additions and 1 deletions

21
ev.c
View File

@ -540,7 +540,7 @@ void ev_loop (int flags)
if (timercnt)
{
ev_tstamp to = timers [0]->at - get_clock () + method_fudge;
ev_tstamp to = timers [0]->at - (have_monotonic ? get_clock () : ev_now) + method_fudge;
if (block > to) block = to;
}
@ -679,9 +679,28 @@ evtimer_stop (struct ev_timer *w)
downheap ((WT *)timers, timercnt, w->active - 1);
}
w->at = w->repeat;
ev_stop ((W)w);
}
void
evtimer_again (struct ev_timer *w)
{
if (ev_is_active (w))
{
if (w->repeat)
{
w->at = now + w->repeat;
downheap ((WT *)timers, timercnt, w->active - 1);
}
else
evtimer_stop (w);
}
else if (w->repeat)
evtimer_start (w);
}
void
evperiodic_start (struct ev_periodic *w)
{

1
ev.h
View File

@ -146,6 +146,7 @@ void evio_stop (struct ev_io *w);
void evtimer_start (struct ev_timer *w);
void evtimer_stop (struct ev_timer *w);
void evtimer_again (struct ev_timer *w); /* stops if active and no repeat, restarts if active and repeating, starts if inactive and repeating */
void evperiodic_start (struct ev_periodic *w);
void evperiodic_stop (struct ev_periodic *w);