Merge pull request #646 from adriaan42/develop

Prevent possible data race in access to Timer::_periodicInerval
This commit is contained in:
Aleksandar Fabijanic
2015-01-25 21:05:12 -06:00

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;