summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-05-31 15:46:04 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-07 13:46:53 +0100
commit28a7d3943ef915c405b3552ae06f639a86f4dc1e (patch)
tree2ef01e56d3f049a2d1ae2144747d99e88040a0da /lib
parent534215a18fb3fb7ce5b26c9e6ec1fdb32bf22ae6 (diff)
Timers: Integrate microsecond timers to the main loop
Diffstat (limited to 'lib')
-rw-r--r--lib/timer.c6
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);
}
}