Fix deadlock in ThreadPool::Join.

Refs #4986
This commit is contained in:
Gunnar Beutner 2013-10-31 19:09:51 +01:00
parent 060e772ce3
commit 6abf16e6ed

View File

@ -236,6 +236,7 @@ void ThreadPool::ManagerThreadProc(void)
{ {
boost::mutex::scoped_lock lock(m_Mutex); boost::mutex::scoped_lock lock(m_Mutex);
if (!m_Stopped)
m_MgmtCV.timed_wait(lock, boost::posix_time::seconds(5)); m_MgmtCV.timed_wait(lock, boost::posix_time::seconds(5));
if (m_Stopped) if (m_Stopped)
@ -345,6 +346,7 @@ void ThreadPool::StatsThreadProc(void)
for (;;) { for (;;) {
boost::mutex::scoped_lock lock(m_Mutex); boost::mutex::scoped_lock lock(m_Mutex);
if (!m_Stopped)
m_MgmtCV.timed_wait(lock, boost::posix_time::milliseconds(250)); m_MgmtCV.timed_wait(lock, boost::posix_time::milliseconds(250));
if (m_Stopped) if (m_Stopped)