[icinga-checkins] icinga.org: icinga2/master: livestatus: hoststable: lock service object for acknowledgement getters

git at icinga.org git at icinga.org
Fri Jul 5 11:47:03 CEST 2013


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Fri Jul  5 11:28:05 2013 +0200

livestatus: hoststable: lock service object for  acknowledgement getters

refs #4372

---

 components/livestatus/hoststable.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/components/livestatus/hoststable.cpp b/components/livestatus/hoststable.cpp
index 35276c6..525f1f3 100644
--- a/components/livestatus/hoststable.cpp
+++ b/components/livestatus/hoststable.cpp
@@ -24,6 +24,7 @@
 #include "icinga/eventcommand.h"
 #include "icinga/timeperiod.h"
 #include "base/dynamictype.h"
+#include "base/objectlock.h"
 #include <boost/foreach.hpp>
 #include <boost/smart_ptr/make_shared.hpp>
 
@@ -420,6 +421,8 @@ Value HostsTable::AcknowledgementTypeAccessor(const Object::Ptr& object)
 	if (!hc)
 		return Value();
 
+	ObjectLock olock(hc);
+
 	return static_cast<int>(hc->GetAcknowledgement());
 }
 
@@ -547,6 +550,8 @@ Value HostsTable::AcknowledgedAccessor(const Object::Ptr& object)
 	if (!hc)
 		return Value();
 
+	ObjectLock olock(hc);
+
 	return (hc->IsAcknowledged() ? 1 : 0);
 }
 





More information about the icinga-checkins mailing list