From 3d1490529fcd18aadfa6748cceb75ff907fc6599 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 29 Aug 2016 14:12:29 +0200 Subject: [PATCH] Fix race condition for concurrent_checks fixes #11932 --- lib/checker/checkercomponent.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/checker/checkercomponent.cpp b/lib/checker/checkercomponent.cpp index ac8da330a..89cb45be9 100644 --- a/lib/checker/checkercomponent.cpp +++ b/lib/checker/checkercomponent.cpp @@ -193,6 +193,8 @@ void CheckerComponent::CheckThreadProc(void) Log(LogDebug, "CheckerComponent") << "Executing check for '" << checkable->GetName() << "'"; + Checkable::IncreasePendingChecks(); + Utility::QueueAsyncCallback(boost::bind(&CheckerComponent::ExecuteCheckHelper, CheckerComponent::Ptr(this), checkable)); lock.lock(); @@ -221,6 +223,8 @@ void CheckerComponent::ExecuteCheckHelper(const Checkable::Ptr& checkable) Log(LogCritical, "checker", output); } + Checkable::DecreasePendingChecks(); + { boost::mutex::scoped_lock lock(m_Mutex);