Commit 0448d1ce authored by Georgios Bitzes's avatar Georgios Bitzes Committed by Elvin Sindrilaru

COMMON: Fix data-race on RWMutex::mTransientDeadlockCheck, make atomic

WARNING: ThreadSanitizer: data race (pid=15845) Read of size 1 at 0x7fe91502ce11 by thread T182: #0 eos::common::RWMutex::LockRead() /afs/cern.ch/user/g/gbitzes/dev/eos-dev/common/RWMutex.cc:259 (libeosCommon.so.4+0x000000043a5c) #1 eos::common::RWMutexReadLock::RWMutexReadLock(eos::common::RWMutex&) /afs/cern.ch/user/g/gbitzes/dev/eos-dev/common/RWMutex.cc:1309 (libeosCommon.so.4+0x000000043cc9) .... Previous write of size 1 at 0x7fe91502ce11 by thread T7: #0 eos::common::RWMutex::UnLockRead() /afs/cern.ch/user/g/gbitzes/dev/eos-dev/common/RWMutex.cc:300 (libeosCommon.so.4+0x000000044913) #1 eos::common::RWMutexReadLock::~RWMutexReadLock() /afs/cern.ch/user/g/gbitzes/dev/eos-dev/common/RWMutex.cc:1341 (libeosCommon.so.4+0x000000044a12) ....
parent f6acb0c3
......@@ -491,7 +491,7 @@ private:
std::set<std::thread::id> mThreadsWrLock; ///< Threads holding a write lock
pthread_mutex_t mCollectionMutex; ///< Mutex protecting the sets above
bool mEnableDeadlockCheck; ///< Check for deadlocks
bool mTransientDeadlockCheck; ///< Enabled by the global flag
std::atomic<bool> mTransientDeadlockCheck; ///< Enabled by the global flag
static bool staticInitialized;
static bool sEnableGlobalTiming;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment