mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-06 13:24:28 +02:00
/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);
|
||||
AsioConditionVariable dontLockOwnStrand (stream.get_io_service(), true);
|
||||
|
||||
for (;;) {
|
||||
auto event (queue->WaitForEvent(&request, yc));
|
||||
@ -119,6 +120,8 @@ bool EventsHandler::HandleRequest(
|
||||
stream.async_flush(yc);
|
||||
} else if (server.Disconnected()) {
|
||||
return true;
|
||||
} else {
|
||||
dontLockOwnStrand.Wait(yc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user