]> granicus.if.org Git - icinga2/commitdiff
add some object locking to the Dump method (which could theoreticylly suffer from...
authorElias Ohm <eohm@novomind.com>
Wed, 1 May 2019 09:49:07 +0000 (11:49 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 16 May 2019 14:31:01 +0000 (16:31 +0200)
(cherry picked from commit 44ac6cf1ecd10f2bd5e9b837e78da5dc5257a180)

lib/icinga/timeperiod.cpp

index f71e36c74e4d64153c3afd630f3f0552a2a750a8..7ed74c5ea5c15095cfee648bc5d30a5465e7b1e6 100644 (file)
@@ -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")