Fix deadlock in WorkQueue::Enqueue.

Fixes #5120
This commit is contained in:
Gunnar Beutner 2013-11-21 13:54:01 +01:00
parent ab388ce837
commit 7a79886922
1 changed files with 4 additions and 2 deletions

View File

@ -51,8 +51,10 @@ void WorkQueue::Enqueue(const WorkCallback& item)
ASSERT(!m_Stopped);
while (m_Items.size() >= m_MaxItems)
m_CV.wait(lock);
if (boost::this_thread::get_id() != GetThreadId()) {
while (m_Items.size() >= m_MaxItems)
m_CV.wait(lock);
}
m_Items.push_back(item);
m_CV.notify_all();