mirror of https://github.com/Icinga/icinga2.git
/v1/events: don't deadlock other coroutines
This commit is contained in:
parent
2e5af2922b
commit
2e4e2e1a79
|
@ -101,6 +101,7 @@ bool EventsHandler::HandleRequest(
|
||||||
}
|
}
|
||||||
|
|
||||||
asio::const_buffer newLine ("\n", 1);
|
asio::const_buffer newLine ("\n", 1);
|
||||||
|
AsioConditionVariable dontLockOwnStrand (stream.get_io_service(), true);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
auto event (queue->WaitForEvent(&request, yc));
|
auto event (queue->WaitForEvent(&request, yc));
|
||||||
|
@ -119,6 +120,8 @@ bool EventsHandler::HandleRequest(
|
||||||
stream.async_flush(yc);
|
stream.async_flush(yc);
|
||||||
} else if (server.Disconnected()) {
|
} else if (server.Disconnected()) {
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
dontLockOwnStrand.Wait(yc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue