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
1 changed files with 4 additions and 2 deletions

View File

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