Import Geant4 11.1.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2022-07-01 10:44:02 +02:00
parent b3bf75a2a1
commit c07cea1fe0
2172 changed files with 183300 additions and 123938 deletions
+4 -2
View File
@@ -383,7 +383,7 @@ G4ProfilerConfig<Ct>::GetPersistent()
// assigned defaults in G4RunManager::ConfigureProfilers() but if the user
// assigns new settings before creating G4RunManager, those defaults will
// be ignored
static PersistentSettings<Idx>* _instance =
static auto* _instance =
new PersistentSettings<Idx>(GetPersistentFallback<Idx>());
static thread_local PersistentSettings<Idx>* _tlinstance = [=]() {
static std::mutex mtx;
@@ -392,8 +392,10 @@ G4ProfilerConfig<Ct>::GetPersistent()
// above. Modifying that instance will result in all threads created later
// to inherit those settings
static bool _first = true;
if(_first) // below uses comma operator to assign to false before return
if(_first)
{ // below uses comma operator to assign to false before return
return ((_first = false), _instance);
}
// if not first, make a copy from the primary thread
return new PersistentSettings<Idx>(*_instance);
}();