livestatus: hoststable: lock service object for acknowledgement getters

refs #4372
This commit is contained in:
Michael Friedrich 2013-07-05 11:28:05 +02:00
parent e448374674
commit 69cb48242f
1 changed files with 5 additions and 0 deletions

View File

@ -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);
}