diff options
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | ev.h | 4 | ||||
-rw-r--r-- | ev.pod | 10 |
3 files changed, 9 insertions, 6 deletions
@@ -4,6 +4,7 @@ Revision history for libev, a high-performance and full-featured event loop. for better cache-efficiency and increases memory requirements by up to two pointers/loop. - fix a potential aliasing issue in ev_timer_again. + - add/document ev_periodic_at, retract diretc access to ->at. 3.31 Wed Apr 16 20:45:04 CEST 2008 - added last minute fix for ev_poll.c by Brandon Black. @@ -515,7 +515,7 @@ void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revent } while (0) #define ev_io_set(ev,fd_,events_) do { (ev)->fd = (fd_); (ev)->events = (events_) | EV_IOFDSET; } while (0) -#define ev_timer_set(ev,after_,repeat_) do { (ev)->at = (after_); (ev)->repeat = (repeat_); } while (0) +#define ev_timer_set(ev,after_,repeat_) do { ((ev_watcher_time *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0) #define ev_periodic_set(ev,ofs_,ival_,res_) do { (ev)->offset = (ofs_); (ev)->interval = (ival_); (ev)->reschedule_cb= (res_); } while (0) #define ev_signal_set(ev,signum_) do { (ev)->signum = (signum_); } while (0) #define ev_child_set(ev,pid_,trace_) do { (ev)->pid = (pid_); (ev)->flags = !!(trace_); } while (0) @@ -547,6 +547,8 @@ void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revent #define ev_cb(ev) (ev)->cb /* rw */ #define ev_set_priority(ev,pri) ((ev_watcher *)(void *)(ev))->priority = (pri) +#define ev_periodic_at(ev) (((ev_watcher_time *)(ev))->at + 0.) + #ifndef ev_set_cb # define ev_set_cb(ev,cb_) ev_cb (ev) = (cb_) #endif @@ -1375,6 +1375,11 @@ when you changed some parameters or the reschedule callback would return a different time than the last time it was called (e.g. in a crond like program when the crontabs have changed). +=item ev_tstamp ev_periodic_at (ev_periodic *) + +When active, returns the absolute time that the watcher is supposed to +trigger next. + =item ev_tstamp offset [read-write] When repeating, this contains the offset value, otherwise this is the @@ -1395,11 +1400,6 @@ The current reschedule callback, or C<0>, if this functionality is switched off. Can be changed any time, but changes only take effect when the periodic timer fires or C<ev_periodic_again> is being called. -=item ev_tstamp at [read-only] - -When active, contains the absolute time that the watcher is supposed to -trigger next. - =back =head3 Examples |