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:
parent
e820222c5b
commit
440c676be2
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue