event/TimerWheel: add a "ready" list as a special case

This reduces delays of zero-duration timers from up to 1 second to
zero.  libavahi-client schedules zero-duration timers often.
This commit is contained in:
Max Kellermann
2021-03-02 00:25:04 +01:00
committed by Max Kellermann
parent 0091c4e12b
commit f5f296b13a
3 changed files with 34 additions and 12 deletions

View File

@@ -145,7 +145,7 @@ EventLoop::AbandonFD(SocketEvent &event) noexcept
void
EventLoop::Insert(CoarseTimerEvent &t) noexcept
{
coarse_timers.Insert(t);
coarse_timers.Insert(t, SteadyNow());
again = true;
}