Commit Graph
3 Commits
Author SHA1 Message Date
NefelibateLG 28643fa599 Return from uev_run() when UEV_NONBLOCK and no event is pending
uev_run() with only UEV_NONBLOCK never returns when there are watchers
but no events, it spins at full CPU load:

    uev_run(ctx, UEV_NONBLOCK);

The loop polls epoll with a zero timeout and only stops on UEV_ONCE.

Leave the loop when a nonblocking poll finds no events.
2026-11-16 15:08:42 +01:00
omrzk 09d9b6ba04 Keep timer deadlines between calls to uev_run()
Timers never expire when the event loop is run one iteration at a time
and something else keeps it busy, e.g., when polled from another event
loop:

    uev_run(ctx, UEV_ONCE | UEV_NONBLOCK);

Every call to uev_run() starts all timers over from their full timeout.

Start dormant timers on the first call only.  A caller that wants a
timer restarted for each call must now use uev_timer_set().

Closes #36
2026-11-16 15:08:41 +01:00
Joachim Wiberg 7b1e0eb551 Relocate most documentation to doc/
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-13 23:22:44 +02:00