mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
add some object locking to the Dump method (which could theoreticylly suffer from same reace condition as serializer)
(cherry picked from commit 44ac6cf1ecd10f2bd5e9b837e78da5dc5257a180)
This commit is contained in:
parent
68418eb6bc
commit
22fcdd868d
@ -238,6 +238,7 @@ void TimePeriod::Merge(const TimePeriod::Ptr& timeperiod, bool include)
|
|||||||
void TimePeriod::UpdateRegion(double begin, double end, bool clearExisting)
|
void TimePeriod::UpdateRegion(double begin, double end, bool clearExisting)
|
||||||
{
|
{
|
||||||
if (clearExisting) {
|
if (clearExisting) {
|
||||||
|
ObjectLock olock(this);
|
||||||
SetSegments(new Array());
|
SetSegments(new Array());
|
||||||
} else {
|
} else {
|
||||||
if (begin < GetValidEnd())
|
if (begin < GetValidEnd())
|
||||||
@ -363,6 +364,8 @@ void TimePeriod::UpdateTimerHandler()
|
|||||||
|
|
||||||
void TimePeriod::Dump()
|
void TimePeriod::Dump()
|
||||||
{
|
{
|
||||||
|
ObjectLock olock(this);
|
||||||
|
|
||||||
Array::Ptr segments = GetSegments();
|
Array::Ptr segments = GetSegments();
|
||||||
|
|
||||||
Log(LogDebug, "TimePeriod")
|
Log(LogDebug, "TimePeriod")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user