diff --git a/lib/icinga/checkable-notification.cpp b/lib/icinga/checkable-notification.cpp index 25218d8d3..4bcb63347 100644 --- a/lib/icinga/checkable-notification.cpp +++ b/lib/icinga/checkable-notification.cpp @@ -84,16 +84,19 @@ void Checkable::SendNotifications(NotificationType type, const CheckResult::Ptr& std::set Checkable::GetNotifications(void) const { + boost::mutex::scoped_lock lock(m_NotificationMutex); return m_Notifications; } void Checkable::AddNotification(const Notification::Ptr& notification) { + boost::mutex::scoped_lock lock(m_NotificationMutex); m_Notifications.insert(notification); } void Checkable::RemoveNotification(const Notification::Ptr& notification) { + boost::mutex::scoped_lock lock(m_NotificationMutex); m_Notifications.erase(notification); } diff --git a/lib/icinga/checkable.hpp b/lib/icinga/checkable.hpp index f9f27450e..eb2e2dc90 100644 --- a/lib/icinga/checkable.hpp +++ b/lib/icinga/checkable.hpp @@ -302,6 +302,7 @@ private: /* Notifications */ std::set m_Notifications; + mutable boost::mutex m_NotificationMutex; /* Dependencies */ mutable boost::mutex m_DependencyMutex;