[icinga-checkins] icinga.org: icinga2/master: Fix a deadlock in WorkQueue::WorkerThreadProc

git at icinga.org git at icinga.org
Fri Feb 27 18:33:08 CET 2015


Module: icinga2
Branch: master
Commit: 985c6bc7d912ac0e49ae4c814660ce0f9ef6fc4d
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=985c6bc7d912ac0e49ae4c814660ce0f9ef6fc4d

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Fri Feb 27 18:29:21 2015 +0100

Fix a deadlock in WorkQueue::WorkerThreadProc

refs #8554

---

 lib/base/workqueue.cpp |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/base/workqueue.cpp b/lib/base/workqueue.cpp
index 427bbca..e8209fe 100644
--- a/lib/base/workqueue.cpp
+++ b/lib/base/workqueue.cpp
@@ -220,6 +220,10 @@ void WorkQueue::WorkerThreadProc(void)
 				m_ExceptionCallback(boost::current_exception());
 		}
 
+		/* clear the task so whatever other resources it holds are released
+		   _before_ we re-acquire the mutex */
+		task = Task();
+
 		lock.lock();
 
 		m_Processing--;



More information about the icinga-checkins mailing list