Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed function static to atomic in RunRangeDependentPedeLabeler #18297

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -9,6 +9,7 @@
*/

#include <algorithm>
#include <atomic>

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Parse.h"
Expand Down Expand Up @@ -346,7 +347,7 @@ unsigned int RunRangeDependentPedeLabeler::buildRunRangeDependencyMap(AlignableT
AlignableExtras *aliExtras,
const edm::ParameterSet &config)
{
static bool oldRunRangeSelectionWarning = false;
static std::atomic<bool> oldRunRangeSelectionWarning{ false };

theAlignableToRunRangeRangeMap.clear();

Expand Down Expand Up @@ -381,12 +382,12 @@ unsigned int RunRangeDependentPedeLabeler::buildRunRangeDependencyMap(AlignableT

} else {

if (!oldRunRangeSelectionWarning) {
bool expected = false;
if (oldRunRangeSelectionWarning.compare_exchange_strong(expected,true)) {
edm::LogWarning("BadConfig") << "@SUB=RunRangeDependentPedeLabeler::buildRunRangeDependencyMap"
<< "Config file contains old format for 'RunRangeSelection'. Only the start run\n"
<< "number is used internally. The number of the last run is ignored and can be\n"
<< "safely removed from the config file.\n";
oldRunRangeSelectionWarning = true;
}

std::vector<std::string> tokens = edm::tokenize(*iRunRange, ":");
Expand Down