mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-09 12:48:43 +00:00
If the main event queue is not empty, call select() with zero timeout, so
that the events are ran again after the FD's are checked. This allows us to schedule I/O checks between processing of user commands.
This commit is contained in:
parent
84a7d7f77c
commit
30770df2ab
@ -894,7 +894,7 @@ io_loop(void)
|
||||
fd_set rd, wr;
|
||||
struct timeval timo;
|
||||
time_t tout;
|
||||
int hi;
|
||||
int hi, events;
|
||||
sock *s;
|
||||
node *n, *p;
|
||||
|
||||
@ -904,7 +904,7 @@ io_loop(void)
|
||||
FD_ZERO(&wr);
|
||||
for(;;)
|
||||
{
|
||||
ev_run_list(&global_event_list);
|
||||
events = ev_run_list(&global_event_list);
|
||||
now = time(NULL);
|
||||
tout = tm_first_shot();
|
||||
if (tout <= now)
|
||||
@ -912,11 +912,8 @@ io_loop(void)
|
||||
tm_shot();
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
timo.tv_sec = tout - now;
|
||||
timo.tv_usec = 0;
|
||||
}
|
||||
timo.tv_sec = events ? 0 : tout - now;
|
||||
timo.tv_usec = 0;
|
||||
|
||||
hi = 0;
|
||||
WALK_LIST(n, sock_list)
|
||||
|
Loading…
Reference in New Issue
Block a user