event/Call: invoke function directly if the EventLoop is dead

Works around a deadlock bug which happens when waiting for an
EventLoop which isn't running anymore.
This commit is contained in:
Max Kellermann 2018-01-29 23:06:43 +01:00
parent ce68701c0c
commit 3fd9a86f3c
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ private:
void
BlockingCall(EventLoop &loop, std::function<void()> &&f)
{
if (loop.IsInside()) {
if (loop.IsDead() || loop.IsInside()) {
/* we're already inside the loop - we can simply call
the function */
f();