mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-28 08:04:14 +02:00
EventQueue#WaitForEvent(): don't lock I/O thread while locking mutex
This commit is contained in:
parent
dc0288fef8
commit
09a2e04f4b
@ -106,15 +106,17 @@ Dictionary::Ptr EventQueue::WaitForEvent(void *client, boost::asio::yield_contex
|
|||||||
{
|
{
|
||||||
for (;;) {
|
for (;;) {
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(m_Mutex);
|
boost::mutex::scoped_try_lock lock(m_Mutex);
|
||||||
|
|
||||||
auto it = m_Events.find(client);
|
if (lock.owns_lock()) {
|
||||||
ASSERT(it != m_Events.end());
|
auto it = m_Events.find(client);
|
||||||
|
ASSERT(it != m_Events.end());
|
||||||
|
|
||||||
if (!it->second.empty()) {
|
if (!it->second.empty()) {
|
||||||
Dictionary::Ptr result = *it->second.begin();
|
Dictionary::Ptr result = *it->second.begin();
|
||||||
it->second.pop_front();
|
it->second.pop_front();
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user