mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 03:20:11 +01:00
Fix/tsan (#3617)
* fix(Foundation): tsan warnings fixes * fix(Thread_POSIX): tsan warnings fixes; add tsan.suppress * fix(Util): tsan fixes * fix(netSSL_OpenSSL): tsan fixes * fix(Data): tsan warnings fixes * feat(ci): add tsan job * feat(ci): add tsan job, another attempt * feat(ci): add tsan job, 3rd attempt * fix(Foundation): tsan warnings fixes * fix(Thread_POSIX): tsan warnings fixes; add tsan.suppress * fix(Util): tsan fixes * fix(netSSL_OpenSSL): tsan fixes * fix(Data): tsan warnings fixes * feat(ci): add tsan job * feat(ci): add tsan job, another attempt * feat(ci): add tsan job, 3rd attempt * fix(ResultMetadata): memory leak #3474 * feat(ci): disable ActiveDispatcher tests for tsan runs * feat(ci): try to fix tsan options file detection (again) * chore(TestLibrary: correct spelling * fix(ci): fix tsan run; add -y to apt; disable samples build for some jobs * fix(ci): add mysql ports * feat(ci): add VS asan * feat(double-conversion): Upgrade double-conversion to v3.2.0 #3624 * chore(asan): disable msvc asan build (dll not found) * chore(double-conversion): move NumericString.h before double-conversion includes to prevent min/max collision; reinstate lost loongarch64 * chore(JSON): sync pdjson with upstream * fix(Statement): Poco::Data::Statement becomes unusable after exception #2287
This commit is contained in:
committed by
GitHub
parent
17fec1b985
commit
ff879f5905
@@ -23,6 +23,7 @@
|
||||
#include "Poco/RefCountedObject.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
#include "Poco/Timestamp.h"
|
||||
#include "Poco/Mutex.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -62,6 +63,9 @@ public:
|
||||
///
|
||||
/// Returns 0 if the timer has never been executed.
|
||||
|
||||
void updateLastExecution();
|
||||
/// Updates the last execution of the timer task.
|
||||
|
||||
protected:
|
||||
~TimerTask();
|
||||
/// Destroys the TimerTask.
|
||||
@@ -71,9 +75,8 @@ private:
|
||||
TimerTask& operator = (const TimerTask&);
|
||||
|
||||
Poco::Timestamp _lastExecution;
|
||||
bool _isCancelled;
|
||||
|
||||
friend class TaskNotification;
|
||||
std::atomic<bool> _isCancelled;
|
||||
mutable FastMutex _mutex;
|
||||
};
|
||||
|
||||
|
||||
@@ -114,10 +117,18 @@ inline bool TimerTask::isCancelled() const
|
||||
|
||||
inline Poco::Timestamp TimerTask::lastExecution() const
|
||||
{
|
||||
FastMutex::ScopedLock l(_mutex);
|
||||
return _lastExecution;
|
||||
}
|
||||
|
||||
|
||||
inline void TimerTask::updateLastExecution()
|
||||
{
|
||||
FastMutex::ScopedLock l(_mutex);
|
||||
_lastExecution.update();
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Util
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user