mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Protect access to options container
This commit is contained in:
committed by
Dennis Klein
parent
479d6e0712
commit
db0500fb2d
@@ -93,6 +93,7 @@ void ProgOptions::ParseDefaults()
|
||||
return str.c_str();
|
||||
});
|
||||
|
||||
std::lock_guard<std::mutex> lock(fMtx);
|
||||
po::store(po::parse_command_line(argv.size(), const_cast<char**>(argv.data()), fAllOptions), fVarMap);
|
||||
}
|
||||
|
||||
@@ -390,6 +391,8 @@ void ProgOptions::PrintOptions() const
|
||||
int maxLenType = 0;
|
||||
int maxLenDefault = 0;
|
||||
|
||||
std::lock_guard<std::mutex> lock(fMtx);
|
||||
|
||||
for (const auto& m : fVarMap) {
|
||||
maxLenKey = max(maxLenKey, static_cast<int>(m.first.length()));
|
||||
|
||||
@@ -427,6 +430,8 @@ void ProgOptions::PrintOptions() const
|
||||
|
||||
void ProgOptions::PrintOptionsRaw() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(fMtx);
|
||||
|
||||
const vector<boost::shared_ptr<po::option_description>>& options = fAllOptions.options();
|
||||
|
||||
for (const auto& o : options) {
|
||||
|
Reference in New Issue
Block a user