From 2c9ad5c9509a1ce100df5c0c966ddc27a1283518 Mon Sep 17 00:00:00 2001 From: oko256 <139907514+oko256@users.noreply.github.com> Date: Fri, 19 Apr 2024 18:16:31 +0300 Subject: [PATCH] zloop: ensure zsys_init() when creating zloop If no sockets or actors are used in zloop, `zsys_init()` does not get run and zsys interrupt handler does not get initialized. This means that interrupts will not work correctly in zloop if, for example, only timers are used. `zsys_init()` is safe to call multiple times, so we ensure that it's called when new zloop instance is created. --- src/zloop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/zloop.c b/src/zloop.c index b025a3cd3..6176b6941 100644 --- a/src/zloop.c +++ b/src/zloop.c @@ -313,6 +313,8 @@ s_tickless (zloop_t *self) zloop_t * zloop_new (void) { + zsys_init (); + zloop_t *self = (zloop_t *) zmalloc (sizeof (zloop_t)); assert (self);