Skip to content

Commit

Permalink
zloop: ensure zsys_init() when creating zloop
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oko256 committed Apr 19, 2024
1 parent 4af175a commit 2c9ad5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/zloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2c9ad5c

Please sign in to comment.