mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 12:44:58 +02:00
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/eventcommand.h"
|
||||||
#include "icinga/timeperiod.h"
|
#include "icinga/timeperiod.h"
|
||||||
#include "base/dynamictype.h"
|
#include "base/dynamictype.h"
|
||||||
|
#include "base/objectlock.h"
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/smart_ptr/make_shared.hpp>
|
#include <boost/smart_ptr/make_shared.hpp>
|
||||||
|
|
||||||
@ -420,6 +421,8 @@ Value HostsTable::AcknowledgementTypeAccessor(const Object::Ptr& object)
|
|||||||
if (!hc)
|
if (!hc)
|
||||||
return Value();
|
return Value();
|
||||||
|
|
||||||
|
ObjectLock olock(hc);
|
||||||
|
|
||||||
return static_cast<int>(hc->GetAcknowledgement());
|
return static_cast<int>(hc->GetAcknowledgement());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -547,6 +550,8 @@ Value HostsTable::AcknowledgedAccessor(const Object::Ptr& object)
|
|||||||
if (!hc)
|
if (!hc)
|
||||||
return Value();
|
return Value();
|
||||||
|
|
||||||
|
ObjectLock olock(hc);
|
||||||
|
|
||||||
return (hc->IsAcknowledged() ? 1 : 0);
|
return (hc->IsAcknowledged() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user