From: Gunnar Beutner Date: Thu, 11 Dec 2014 08:33:07 +0000 (+0100) Subject: Fix crash in ThreadPool::Stop X-Git-Tag: v2.3.0~526 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=874970db9e78f130cd0d0d0270d60f156099e77f;p=icinga2 Fix crash in ThreadPool::Stop fixes #8059 --- diff --git a/lib/base/threadpool.cpp b/lib/base/threadpool.cpp index 2a814134f..b39ad0d06 100644 --- a/lib/base/threadpool.cpp +++ b/lib/base/threadpool.cpp @@ -60,7 +60,8 @@ void ThreadPool::Stop(void) m_MgmtCV.notify_all(); } - m_MgmtThread.join(); + if (m_MgmtThread.joinable()) + m_MgmtThread.join(); for (size_t i = 0; i < sizeof(m_Queues) / sizeof(m_Queues[0]); i++) { boost::mutex::scoped_lock lock(m_Queues[i].Mutex);