diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-05-31 15:46:04 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-07 13:46:53 +0100 |
commit | 28a7d3943ef915c405b3552ae06f639a86f4dc1e (patch) | |
tree | 2ef01e56d3f049a2d1ae2144747d99e88040a0da /lib/timer.c | |
parent | 534215a18fb3fb7ce5b26c9e6ec1fdb32bf22ae6 (diff) |
Timers: Integrate microsecond timers to the main loop
Diffstat (limited to 'lib/timer.c')
-rw-r--r-- | lib/timer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/timer.c b/lib/timer.c index 00ac4b03..7ca0bdaa 100644 --- a/lib/timer.c +++ b/lib/timer.c @@ -166,6 +166,8 @@ timers_init(struct timeloop *loop, pool *p) BUFFER_PUSH(loop->timers) = NULL; } +void io_log_event(void *hook, void *data); + void timers_fire(struct timeloop *loop) { @@ -195,6 +197,10 @@ timers_fire(struct timeloop *loop) else tm2_stop(t); + /* This is ugly hack, we want to log just timers executed from the main I/O loop */ + if (loop == &main_timeloop) + io_log_event(t->hook, t->data); + t->hook(t); } } |