|
uloop_process_timeouts(); |
|
|
|
if (do_sigchld) |
|
uloop_handle_processes(); |
|
|
|
if (uloop_cancelled) |
|
break; |
|
|
|
next_time = uloop_get_next_timeout(); |
|
if (timeout >= 0 && (next_time < 0 || timeout < next_time)) |
|
next_time = timeout; |
|
uloop_run_events(next_time); |
consider the following case:
uloop_run_events (-1)
was entered when there is no next_timeout
and then executing uloop_timeout_add
to add a timeout "task" that will not wake up uloop_run_events
the timeout "task" will never be executed.