Prevent possible data race in access to Timer::_periodicInerval

This commit is contained in:
Adriaan Schmidt 2014-12-19 11:06:45 +01:00
parent 2fc0e524fa
commit 391deca195

View File

@ -208,6 +208,7 @@ void Timer::run()
{ {
Poco::ErrorHandler::handle(); Poco::ErrorHandler::handle();
} }
Poco::FastMutex::ScopedLock lock(_mutex);
interval = _periodicInterval; interval = _periodicInterval;
} }
_nextInvocation += static_cast<Clock::ClockVal>(interval)*1000; _nextInvocation += static_cast<Clock::ClockVal>(interval)*1000;