mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 23:54:07 +02:00
EventQueue#WaitForEvent(): don't lock I/O thread while locking mutex
This commit is contained in:
parent
dc0288fef8
commit
09a2e04f4b
@ -106,8 +106,9 @@ Dictionary::Ptr EventQueue::WaitForEvent(void *client, boost::asio::yield_contex
|
||||
{
|
||||
for (;;) {
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
boost::mutex::scoped_try_lock lock(m_Mutex);
|
||||
|
||||
if (lock.owns_lock()) {
|
||||
auto it = m_Events.find(client);
|
||||
ASSERT(it != m_Events.end());
|
||||
|
||||
@ -117,6 +118,7 @@ Dictionary::Ptr EventQueue::WaitForEvent(void *client, boost::asio::yield_contex
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IoBoundWorkSlot dontLockTheIoThreadWhileWaiting (yc);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user