diff --git a/lib/config/applyrule.cpp b/lib/config/applyrule.cpp index 5b33765d9..87399711e 100644 --- a/lib/config/applyrule.cpp +++ b/lib/config/applyrule.cpp @@ -126,12 +126,12 @@ const std::vector& ApplyRule::GetTargetTypes(const String& sourceType) void ApplyRule::AddMatch() { - m_HasMatches = true; + m_HasMatches.store(true, std::memory_order_relaxed); } bool ApplyRule::HasMatches() const { - return m_HasMatches; + return m_HasMatches.load(std::memory_order_relaxed); } const std::vector& ApplyRule::GetRules(const Type::Ptr& sourceType, const Type::Ptr& targetType) diff --git a/lib/config/applyrule.hpp b/lib/config/applyrule.hpp index 709c634d3..c5f1709dd 100644 --- a/lib/config/applyrule.hpp +++ b/lib/config/applyrule.hpp @@ -9,6 +9,7 @@ #include "base/shared-object.hpp" #include "base/type.hpp" #include +#include namespace icinga { @@ -101,7 +102,7 @@ private: bool m_IgnoreOnError; DebugInfo m_DebugInfo; Dictionary::Ptr m_Scope; - bool m_HasMatches; + std::atomic m_HasMatches; static TypeMap m_Types; static RuleMap m_Rules;