From 22fcdd868d7dd6ba8095d8964b6f993d6715eab1 Mon Sep 17 00:00:00 2001 From: Elias Ohm Date: Wed, 1 May 2019 11:49:07 +0200 Subject: [PATCH] add some object locking to the Dump method (which could theoreticylly suffer from same reace condition as serializer) (cherry picked from commit 44ac6cf1ecd10f2bd5e9b837e78da5dc5257a180) --- lib/icinga/timeperiod.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index f71e36c74..7ed74c5ea 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -238,6 +238,7 @@ void TimePeriod::Merge(const TimePeriod::Ptr& timeperiod, bool include) void TimePeriod::UpdateRegion(double begin, double end, bool clearExisting) { if (clearExisting) { + ObjectLock olock(this); SetSegments(new Array()); } else { if (begin < GetValidEnd()) @@ -363,6 +364,8 @@ void TimePeriod::UpdateTimerHandler() void TimePeriod::Dump() { + ObjectLock olock(this); + Array::Ptr segments = GetSegments(); Log(LogDebug, "TimePeriod") -- 2.40.0