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:
@@ -151,6 +151,8 @@ EventLoop::AbandonFD(SocketEvent &event) noexcept
|
|||||||
void
|
void
|
||||||
EventLoop::Insert(CoarseTimerEvent &t) noexcept
|
EventLoop::Insert(CoarseTimerEvent &t) noexcept
|
||||||
{
|
{
|
||||||
|
assert(IsInside());
|
||||||
|
|
||||||
coarse_timers.Insert(t, SteadyNow());
|
coarse_timers.Insert(t, SteadyNow());
|
||||||
again = true;
|
again = true;
|
||||||
}
|
}
|
||||||
@@ -192,6 +194,8 @@ EventLoop::AddDefer(DeferEvent &e) noexcept
|
|||||||
void
|
void
|
||||||
EventLoop::AddIdle(DeferEvent &e) noexcept
|
EventLoop::AddIdle(DeferEvent &e) noexcept
|
||||||
{
|
{
|
||||||
|
assert(IsInside());
|
||||||
|
|
||||||
idle.push_back(e);
|
idle.push_back(e);
|
||||||
again = true;
|
again = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user