mirror of https://github.com/Icinga/icinga2.git
livestatus: hoststable: lock service object for acknowledgement getters
refs #4372
This commit is contained in:
parent
e448374674
commit
69cb48242f
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue