diff options
author | Maria Matejka <mq@ucw.cz> | 2022-09-11 22:26:24 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-09-18 16:33:51 +0200 |
commit | 66f27005ec1a3e1fa78733aad56dcd976fbb2744 (patch) | |
tree | d6b8b1caf94e32c697d954e6339900005cfe04bd /sysdep/unix | |
parent | c49ee6e1a673fc1dc396857dbf8a73fa5d9d6b74 (diff) |
Cancelling all timers when loop stops
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/io-loop.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index 3e3fc31a..b7c858c6 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -560,8 +560,11 @@ birdloop_main(void *arg) /* Flush remaining events */ ASSERT_DIE(!ev_run_list(&loop->event_list)); - /* No timers allowed */ - ASSERT_DIE(timers_count(&loop->time) == 0); + /* Drop timers */ + while (t = timers_first(&loop->time)) + tm_stop(t); + + /* No sockets allowed */ ASSERT_DIE(EMPTY_LIST(loop->sock_list)); ASSERT_DIE(loop->sock_num == 0); |