From 44ac6cf1ecd10f2bd5e9b837e78da5dc5257a180 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) --- lib/icinga/timeperiod.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index 21b1271d7..27b92d550 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -221,6 +221,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()) @@ -346,6 +347,8 @@ void TimePeriod::UpdateTimerHandler() void TimePeriod::Dump() { + ObjectLock olock(this); + Array::Ptr segments = GetSegments(); Log(LogDebug, "TimePeriod")