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:
@@ -81,7 +81,7 @@ private:
|
|||||||
void
|
void
|
||||||
BlockingCall(EventLoop &loop, std::function<void()> &&f)
|
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
|
/* we're already inside the loop - we can simply call
|
||||||
the function */
|
the function */
|
||||||
f();
|
f();
|
||||||
|
Reference in New Issue
Block a user