EventLoop: added assert(IsInside()) in Insert(CoarseTimerEvent &) and AddIdle(DeferEvent &)

Like AddDefer(DeferEvent &), Insert(FineTimerEvent &), these methods don't lock to update EventLoop::again
This commit is contained in:
gd
2022-11-10 11:09:44 +02:00
committed by Max Kellermann
parent e820222c5b
commit 440c676be2

View File

@@ -151,6 +151,8 @@ EventLoop::AbandonFD(SocketEvent &event) noexcept
void
EventLoop::Insert(CoarseTimerEvent &t) noexcept
{
assert(IsInside());
coarse_timers.Insert(t, SteadyNow());
again = true;
}
@@ -192,6 +194,8 @@ EventLoop::AddDefer(DeferEvent &e) noexcept
void
EventLoop::AddIdle(DeferEvent &e) noexcept
{
assert(IsInside());
idle.push_back(e);
again = true;
}