Add missing mutex for AddNotification/RemoveNotification

fixes #8311
This commit is contained in:
Gunnar Beutner 2015-01-29 13:18:46 +01:00
parent fb323ee215
commit a3e0c9d898
2 changed files with 4 additions and 0 deletions

View File

@ -84,16 +84,19 @@ void Checkable::SendNotifications(NotificationType type, const CheckResult::Ptr&
std::set<Notification::Ptr> 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);
}

View File

@ -302,6 +302,7 @@ private:
/* Notifications */
std::set<Notification::Ptr> m_Notifications;
mutable boost::mutex m_NotificationMutex;
/* Dependencies */
mutable boost::mutex m_DependencyMutex;