make timers best-effort non-drifting

master
Marc Alexander Lehmann 2007-11-11 00:05:59 +00:00
parent c2f091b5fa
commit eeea948092
2 changed files with 16 additions and 1 deletions

15
ev++.h
View File

@ -46,6 +46,21 @@ namespace ev {
#include "ev.h"
enum {
UNDEF = EV_UNDEF,
NONE = EV_NONE,
READ = EV_READ,
WRITE = EV_WRITE,
TIMEOUT = EV_TIMEOUT,
PERIODIC = EV_PERIODIC,
SIGNAL = EV_SIGNAL,
IDLE = EV_IDLE,
CHECK = EV_CHECK,
PREPARE = EV_PREPARE,
CHILD = EV_CHILD,
ERROR = EV_ERROR,
};
typedef ev_tstamp tstamp;
inline ev_tstamp now (EV_P)

2
ev.c
View File

@ -1339,7 +1339,7 @@ ev_timer_stop (EV_P_ struct ev_timer *w)
downheap ((WT *)timers, timercnt, ((W)w)->active - 1);
}
((WT)w)->at = w->repeat;
((WT)w)->at -= mn_now;
ev_stop (EV_A_ (W)w);
}