add some object locking to the Dump method (which could theoreticylly suffer from same reace condition as serializer)

(cherry picked from commit 44ac6cf1ec)
This commit is contained in:
Elias Ohm 2019-05-01 11:49:07 +02:00 committed by Michael Friedrich
parent 68418eb6bc
commit 22fcdd868d
1 changed files with 3 additions and 0 deletions

View 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")