openwrt/libubox

`uloop_run_events` was not awakened when the first `timeout` was added.

trnny opened this issue · 0 comments

trnny commented

libubox/uloop.c

Lines 667 to 678 in c1be505

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.