diff --git a/DPGAnalysis/Skims/src/LogErrorEventFilter.cc b/DPGAnalysis/Skims/src/LogErrorEventFilter.cc index 141b2378e8f71..229665ecc1c22 100644 --- a/DPGAnalysis/Skims/src/LogErrorEventFilter.cc +++ b/DPGAnalysis/Skims/src/LogErrorEventFilter.cc @@ -71,9 +71,9 @@ namespace { }; std::unique_ptr, release> make_guard(std::atomic &b) noexcept { bool expected = false; - while (not b.compare_exchange_strong(expected, true)) - ; - + while (not b.compare_exchange_strong(expected, true)) { + expected = false; + } return std::unique_ptr, release>(&b, release()); } @@ -116,7 +116,7 @@ class LogErrorEventFilter : public edm::global::EDFilter statsGuard_; + mutable std::atomic statsGuard_{false}; template static void increment(ErrorSet &scoreboard, Collection &list); diff --git a/FWCore/Framework/src/Path.cc b/FWCore/Framework/src/Path.cc index ba6462aa6f3e1..31726e0055a2b 100644 --- a/FWCore/Framework/src/Path.cc +++ b/FWCore/Framework/src/Path.cc @@ -133,7 +133,7 @@ namespace edm { void Path::threadsafe_setFailedModuleInfo(int nwrwue, bool iExcept) { bool expected = false; - while (stateLock_.compare_exchange_strong(expected, true)) { + while (not stateLock_.compare_exchange_strong(expected, true)) { expected = false; } if (iExcept) {