From 69cb48242f3d55ca9b4ce78fa6be202b48ddc7c5 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 5 Jul 2013 11:28:05 +0200 Subject: [PATCH] livestatus: hoststable: lock service object for acknowledgement getters refs #4372 --- components/livestatus/hoststable.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/livestatus/hoststable.cpp b/components/livestatus/hoststable.cpp index 35276c69a..525f1f3cd 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 #include @@ -420,6 +421,8 @@ Value HostsTable::AcknowledgementTypeAccessor(const Object::Ptr& object) if (!hc) return Value(); + ObjectLock olock(hc); + return static_cast(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); } -- 2.40.0