summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-04-06 11:57:28 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-04-06 11:57:28 +0200
commitbd22d7f41d37dec8f7b8b845f6a18c775e66ddfc (patch)
treeeef231c9251a15f4fa58f183154ed97a7607b04a /sysdep/unix
parent9e7b3ebdf9556d7464911dd39e862b1c003319b3 (diff)
IO: Avoid multiple event cycles in one loop cycle.
Event cycle may took too much time and trigger next timer events, so avoid cycling between timer and event cycles inside the loop cycle.
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 078fe73c..5955dbfe 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -2055,12 +2055,13 @@ io_loop(void)
for(;;)
{
events = ev_run_list(&global_event_list);
+ timers:
update_times();
tout = tm_first_shot();
if (tout <= now)
{
tm_shot();
- continue;
+ goto timers;
}
poll_tout = (events ? 0 : MIN(tout - now, 3)) * 1000; /* Time in milliseconds */