Commit 1f119597 authored by Max Kellermann's avatar Max Kellermann

event/Loop: non-recursive Break() implementation

Simply set the "quit" flag and wake up the thread. This works even if we're inside this thread. Setting "quit" to a new value without mutex protection is usually not safe, but good enough here.
parent 87fce8ef
......@@ -52,10 +52,8 @@ EventLoop::~EventLoop()
void
EventLoop::Break()
{
if (IsInside())
quit = true;
else
AddCall([this]() { Break(); });
quit = true;
wake_fd.Write();
}
bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment