diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/CMakeLists.txt b/InnerDetector/InDetG4/TRT_G4Utilities/CMakeLists.txt index 0dac0e4616010a328cf7f5827c16f2bccf338191..0c3fdb7f128f357163c0afec50fb5b59cf8911d5 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/CMakeLists.txt +++ b/InnerDetector/InDetG4/TRT_G4Utilities/CMakeLists.txt @@ -17,7 +17,7 @@ atlas_add_library( TRT_G4Utilities PUBLIC_HEADERS TRT_G4Utilities PRIVATE_INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES AthenaKernel + LINK_LIBRARIES AthenaKernel CxxUtils PRIVATE_LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} PathResolver ) # Install files from the package: diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..f158b05b7ce372c8bac17ecac17be8c1cdf1ae70 --- /dev/null +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +InnerDetector/InDetG4/TRT_G4Utilities diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh index 8a5a66939bc502e990f93a461afe9b8fa80f8866..1ffa44e9a93fe872a83b00d5653b3e65f6979581 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTOutputFile.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -9,9 +9,9 @@ #include "globals.hh" #include <fstream> #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" - -class TRTOutputFile +class ATLAS_NOT_THREAD_SAFE TRTOutputFile // This class needs give non-const reference for output streaming. static TRTOutputFile* m_pOutputFile cannot be static const. Thread unsafe exit is also used. { public: ~TRTOutputFile(); @@ -38,7 +38,7 @@ private: static TRTOutputFile* m_pOutputFile; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh index b5b5070c9424ebe5f20aea8e767c10fa1795b95a..70e8f70f714e9cba4c863e9926d0744ecb337bae 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParameters.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -9,9 +9,9 @@ #include "globals.hh" #include <map> #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" - -class TRTParameters +class ATLAS_NOT_THREAD_SAFE TRTParameters // static variable and thread unsafe exit are used. { public: ~TRTParameters(); @@ -49,7 +49,7 @@ private: static TRTParameters* s_pParameters; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh index bf69026c77f01fb545d40ae5e3379686304d55d6..62d1cb3ec7d92315fe785859a41c20389729ffad 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfBarrelStraws.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,11 +8,12 @@ #include "globals.hh" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class TRTParameters; -class TRTParametersOfBarrelStraws +class ATLAS_NOT_THREAD_SAFE TRTParametersOfBarrelStraws // Thread unsafe TRTParameters class is used. { friend class TRTConstructionOfBarrelStraws; @@ -62,7 +63,7 @@ class TRTParametersOfBarrelStraws TRTParameters* m_pParameters; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh index 3e04472a3f643b1f27eae7f28c7280f8401312ca..61cc54b44570e3795a0ed2bedae090699c65579e 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesA.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,11 +8,12 @@ #include "globals.hh" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class TRTParameters; -class TRTParametersOfModulesA +class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesA // Thread unsafe TRTParameters class is used. { friend class TRTConstructionOfModulesA; @@ -73,7 +74,7 @@ private: TRTParameters* m_pParameters; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh index 22a3ed10c7d3eb1d70e33efb347229454fc2612e..95b7c0e93bd8f0da1d63f46567da57ffd6855bf9 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesB.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,11 +8,12 @@ #include "globals.hh" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class TRTParameters; -class TRTParametersOfModulesB +class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesB // Thread unsafe TRTParameters class is used. { friend class TRTConstructionOfModulesB; @@ -76,7 +77,7 @@ class TRTParametersOfModulesB TRTParameters* m_pParameters; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh index ea284bac9c22c504f1bf357475da259e6ba8b460..10a02d6d2d3f06a7af8c9b7db4bc726b652ef49b 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfModulesC.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,11 +8,12 @@ #include "globals.hh" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class TRTParameters; -class TRTParametersOfModulesC +class ATLAS_NOT_THREAD_SAFE TRTParametersOfModulesC // Thread unsafe TRTParameters class is used. { friend class TRTConstructionOfModulesC; @@ -76,7 +77,7 @@ private: TRTParameters* m_pParameters; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh index 9b32a16d0d5cb31a8e5d25921d5082f4bff738df..98373f53ff22794307e4d3a4a4d6303db389733e 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfStrawPlanes.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,11 +8,12 @@ #include "globals.hh" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class TRTParameters; -class TRTParametersOfStrawPlanes +class ATLAS_NOT_THREAD_SAFE TRTParametersOfStrawPlanes // Thread unsafe TRTParameters class is used. { friend class TRTConstructionOfStrawPlanes; @@ -73,7 +74,7 @@ class TRTParametersOfStrawPlanes TRTParameters* m_pParameters; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh index ea24aae7b016f94c87612e932a3bd4ce84579361..7076b52b4e8759ed377e228a4f37555470c49631 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsA.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,11 +8,12 @@ #include "globals.hh" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class TRTParameters; -class TRTParametersOfWheelsA +class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsA // Thread unsafe TRTParameters class is used. { friend class TRTConstructionOfWheelsA; @@ -67,7 +68,7 @@ class TRTParametersOfWheelsA TRTParameters* m_pParameters; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh index 4f0988bfba8d381aaf0b53ef66910d476c29ea6d..fbd27905e4da5bc9607356db05185cb6460c4ec6 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsB.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,11 +8,12 @@ #include "globals.hh" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class TRTParameters; -class TRTParametersOfWheelsB +class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsB // Thread unsafe TRTParameters class is used. { friend class TRTConstructionOfWheelsB; @@ -74,7 +75,7 @@ class TRTParametersOfWheelsB TRTParameters* m_pParameters; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh index 841cfcd0708f28d0668cae6d4676ba1b01f0aa32..a3b79e86d930e1bcd6ce153e05247b082cdc2795 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTParametersOfWheelsC.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,11 +8,12 @@ #include "globals.hh" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class TRTParameters; -class TRTParametersOfWheelsC +class ATLAS_NOT_THREAD_SAFE TRTParametersOfWheelsC // Thread unsafe TRTParameters class is used. { friend class TRTConstructionOfWheelsC; @@ -67,7 +68,7 @@ class TRTParametersOfWheelsC TRTParameters* m_pParameters; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh index 14c224166c47a5ab5c08ee812511df8ce317b721..4f0aaf3bf3cf3384b6fbcfec7e9685efe6de9606 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTUtilities.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRTUtilities_hh @@ -8,11 +8,12 @@ #include "globals.hh" #include <fstream> #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class TRTOutputFile; -class TRTUtilities +class ATLAS_NOT_THREAD_SAFE TRTUtilities // This class uses thread unsafe TRTOutputFile. static TRTUtilities utilities cannot be static const for output streaming. { public: ~TRTUtilities(); @@ -42,7 +43,7 @@ private: static TRTUtilities* s_pUtilities; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh index 32cf5355654e3dc03752bec18dde6ed23e219c83..2e469b410c9ff254815b20021dc09584b8e935e8 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh +++ b/InnerDetector/InDetG4/TRT_G4Utilities/TRT_G4Utilities/TRTVisualization.hh @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -8,12 +8,13 @@ #include "globals.hh" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class G4LogicalVolume; class G4VisAttributes; -class TRTVisualization +class ATLAS_NOT_THREAD_SAFE TRTVisualization // static variable and thread unsafe exit are used. { public: ~TRTVisualization(); @@ -45,7 +46,7 @@ class TRTVisualization static TRTVisualization* s_pVisualization; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc index d3588766d2259dd4fd1c317f1b4d7138d75bd66a..b8692eea93f56ced715c6020e07a9817a6d9d4e9 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc +++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParameters.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TRT_G4Utilities/TRTParameters.hh" @@ -42,7 +42,7 @@ TRTParameters::~TRTParameters() // Called by TRTParameters -void TRTParameters::ReadInputFile(std::string fileName) +void TRTParameters::ReadInputFile ATLAS_NOT_THREAD_SAFE (std::string fileName) // Thread unsafe exit function is used. { if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParameters::ReadInputFile" << endmsg; @@ -149,7 +149,7 @@ void TRTParameters::ReadInputFile(std::string fileName) // Called by TRTParameters -void TRTParameters::PrintListOfParameters() const +void TRTParameters::PrintListOfParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTOutputFile class is used. { if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParameters::PrintListOfParameters" << endmsg; @@ -171,7 +171,7 @@ void TRTParameters::PrintListOfParameters() const // Called on demand -int TRTParameters::GetInteger(std::string parameterName) const +int TRTParameters::GetInteger ATLAS_NOT_THREAD_SAFE (std::string parameterName) const // Thread unsafe exit function is used. { int numberOfItems = m_multimapOfParameters.count(parameterName); @@ -203,7 +203,7 @@ int TRTParameters::GetInteger(std::string parameterName) const // Called on demand -double TRTParameters::GetDouble(std::string parameterName) const +double TRTParameters::GetDouble ATLAS_NOT_THREAD_SAFE (std::string parameterName) const // Thread unsafe exit function is used. { int numberOfItems = m_multimapOfParameters.count(parameterName); @@ -235,7 +235,7 @@ double TRTParameters::GetDouble(std::string parameterName) const // Called on demand -void TRTParameters::GetIntegerArray(std::string arrayName, int arraySize, +void TRTParameters::GetIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, int arraySize, // Thread unsafe exit function is used. int* array) const { int numberOfItems = m_multimapOfParameters.count(arrayName); @@ -269,7 +269,7 @@ void TRTParameters::GetIntegerArray(std::string arrayName, int arraySize, // Called on demand -void TRTParameters::GetDoubleArray(std::string arrayName, int arraySize, +void TRTParameters::GetDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, int arraySize, // Thread unsafe exit function is used. double* array) const { int numberOfItems = m_multimapOfParameters.count(arrayName); @@ -303,7 +303,7 @@ void TRTParameters::GetDoubleArray(std::string arrayName, int arraySize, // Called on demand -void TRTParameters::GetPartOfIntegerArray(std::string arrayName, +void TRTParameters::GetPartOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, // Thread unsafe exit function is used. int numberOfDemandedElements, int* array) const { int numberOfItems = m_multimapOfParameters.count(arrayName); @@ -338,7 +338,7 @@ void TRTParameters::GetPartOfIntegerArray(std::string arrayName, // Called on demand -void TRTParameters::GetPartOfDoubleArray(std::string arrayName, +void TRTParameters::GetPartOfDoubleArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, // Thread unsafe exit function is used. int numberOfDemandedElements, double* array) const { int numberOfItems = m_multimapOfParameters.count(arrayName); @@ -373,7 +373,7 @@ void TRTParameters::GetPartOfDoubleArray(std::string arrayName, // Called on demand -int TRTParameters::GetElementOfIntegerArray(std::string arrayName, +int TRTParameters::GetElementOfIntegerArray ATLAS_NOT_THREAD_SAFE (std::string arrayName, // Thread unsafe exit function is used. int elementIndex) const { int numberOfItems = m_multimapOfParameters.count(arrayName); diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc index 4fe73f26018ed64f939e9b228dabdc27e5a69164..028f16c49ae490f217512633ec94bd7e3df34c89 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc +++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfBarrelStraws.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TRT_G4Utilities/TRTParametersOfBarrelStraws.hh" @@ -91,7 +91,7 @@ void TRTParametersOfBarrelStraws::DefineParameters() // Called by TRTParametersOfBarrelStraws -void TRTParametersOfBarrelStraws::PrintParameters() const +void TRTParametersOfBarrelStraws::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used. { if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfBarrelStraws::PrintParameters" << endmsg; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc index 570957533d51bdea3e7059db20481220f921d1e6..660ccce572943e7b78965d5a947f65ea4a03be66 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc +++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfStrawPlanes.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-20120 CERN for the benefit of the ATLAS collaboration */ @@ -130,7 +130,7 @@ void TRTParametersOfStrawPlanes::DefineParameters() // Called by TRTParametersOfStrawPlanes -void TRTParametersOfStrawPlanes::PrintParameters() const +void TRTParametersOfStrawPlanes::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used. { if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfStrawPlanes::PrintParameters" << endmsg; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc index f24e8aeb19682022ced68d28cd86774ba04f6cf9..234e8fd99325e5b59e3e9f21193257679319f9f7 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc +++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsA.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -134,7 +134,7 @@ void TRTParametersOfWheelsA::DefineParameters() // Called by TRTParametersOfWheelsA -void TRTParametersOfWheelsA::PrintParameters() const +void TRTParametersOfWheelsA::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used. { if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsA::PrintParameters" << endmsg; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc index 050246fdb82f91b41c2ea735d5f8596f9778e5fe..f466a0cc18f08bae7d018f1da9e75b2fb10bf835 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc +++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsB.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -146,7 +146,7 @@ void TRTParametersOfWheelsB::DefineParameters() // Called by TRTParametersOfWheelsB -void TRTParametersOfWheelsB::PrintParameters() const +void TRTParametersOfWheelsB::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used. { if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsB::PrintParameters" << endmsg; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc index 801a5534be7a9231463ea277c410ab74a48d7201..7edacf4ed66e043cfccbfb05ca46ed24c470b34f 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc +++ b/InnerDetector/InDetG4/TRT_G4Utilities/src/TRTParametersOfWheelsC.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -134,7 +134,7 @@ void TRTParametersOfWheelsC::DefineParameters() // Called by TRTParametersOfWheelsC -void TRTParametersOfWheelsC::PrintParameters() const +void TRTParametersOfWheelsC::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTUtilities and TRTOutputFile classes are used. { if (msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "######### Method TRTParametersOfWheelsC::PrintParameters" << endmsg; diff --git a/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx b/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx index b697f5213c966af0f9ffa0a4af74b8cf46023d57..ab30309f4b96caa87426f3656e4a77404b2ff83c 100644 --- a/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx +++ b/InnerDetector/InDetG4/TRT_G4Utilities/test/ut_TRTParametersTest.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #define BOOST_TEST_DYN_LINK @@ -9,6 +9,8 @@ #include "TRT_G4Utilities/TRTParameters.hh" #include "TRT_G4Utilities/TRTOutputFile.hh" +ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // This unit test uses thread unsafe TRTParameters and TRTOutputFile classes. + namespace utf = boost::unit_test; struct setupParameters{ diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx index 20979f06e826e7bb311e972e6d63770170dc1a5f..c5ca836bcee8b50e7dc54131ac97b5b0d434ff85 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Class header @@ -154,7 +154,7 @@ void TRTParametersForBarrelHits::DefineParameters() const // Called by TRTParametersForBarrelHits -void TRTParametersForBarrelHits::PrintParameters() const +void TRTParametersForBarrelHits::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTOutputFile is used. { if (m_verboseLevel>5) { G4cout << "######### Method TRTParametersForBarrelHits::PrintParameters" << G4endl; } diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h index f1a40f0ccfd3d6d74fdf9f49396aa9795651e3cb..541580f50800ee96f9d8bdefb7c6f3263684e3ee 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForBarrelHits.h @@ -1,14 +1,16 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRT_G4_SD_TRTParametersForBarrelHits_hh #define TRT_G4_SD_TRTParametersForBarrelHits_hh +#include "CxxUtils/checker_macros.h" + class TRTParameters; class TRTProcessingOfBarrelHits; -class TRTParametersForBarrelHits +class ATLAS_NOT_THREAD_SAFE TRTParametersForBarrelHits // Thread unsafe TRTParameters and TRTProcessingOfBarrelHits classes are used. { public: TRTParametersForBarrelHits(TRTProcessingOfBarrelHits*); diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx index c27b83c12722f97b820eb4a1e0ccd4fa1b9e92d8..080e2776426c5268e4c8efc9442bc075a4616c08 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Class header @@ -102,7 +102,7 @@ void TRTParametersForEndCapHits::DefineParameters() const // Called by TRTParametersForEndCapHits -void TRTParametersForEndCapHits::PrintParameters() const +void TRTParametersForEndCapHits::PrintParameters ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTOutputFile class is used. { if (m_verboseLevel>5) { G4cout << "######### Method TRTParametersForEndCapHits::PrintParameters" << G4endl; } diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h index 01ddaee4e73ff533513f3fe9b1ba407d2101f8f0..af25dcf46a0e60acb6d94e4aa81f1b5af5e9c3cb 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTParametersForEndCapHits.h @@ -1,14 +1,16 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRT_G4_SD_TRTParametersForEndCapHits_hh #define TRT_G4_SD_TRTParametersForEndCapHits_hh +#include "CxxUtils/checker_macros.h" + class TRTParameters; class TRTProcessingOfEndCapHits; -class TRTParametersForEndCapHits +class ATLAS_NOT_THREAD_SAFE TRTParametersForEndCapHits // Thread unsafe TRTParameters and TRTProcessingOfEndCapHits classes are used. { public: TRTParametersForEndCapHits(TRTProcessingOfEndCapHits*); diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h index 02c6169617e23501062d5a2846d12d31b16d9694..abe80a0441e4f165e23cd9400330ab0ce5de9f98 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTPrintingOfHits.h @@ -12,7 +12,7 @@ class TRTUncompressedHit; class TRTOutputFile; -class TRTPrintingOfHits +class ATLAS_NOT_THREAD_SAFE TRTPrintingOfHits // Thread unsafe TRTOutputFile class is used. { public: TRTPrintingOfHits(); diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h index b6220defffb663ee6c2a38fbdc9ce856e45f2ce9..03308dd8cc8d062e474458411b5e87f3891db082 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfBarrelHits.h @@ -1,16 +1,18 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRT_G4_SD_TRTProcessingOfBarrelHits_hh #define TRT_G4_SD_TRTProcessingOfBarrelHits_hh +#include "CxxUtils/checker_macros.h" + class TRTParameters; class TRTSensitiveDetector; class G4Step; -class TRTProcessingOfBarrelHits +class ATLAS_NOT_THREAD_SAFE TRTProcessingOfBarrelHits // Thread unsafe TRTParameters and TRTSensitiveDetector classes are used. { friend class TRTParametersForBarrelHits; diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h index bf9a8559ad6874df832f968e0e25dab2ba567e59..56cc07d087dd590a70d7af673fd513b2a4b45775 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTProcessingOfEndCapHits.h @@ -1,16 +1,18 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRT_G4_SD_TRTProcessingOfEndCapHits_hh #define TRT_G4_SD_TRTProcessingOfEndCapHits_hh +#include "CxxUtils/checker_macros.h" + class TRTParameters; class TRTSensitiveDetector; class G4Step; -class TRTProcessingOfEndCapHits +class ATLAS_NOT_THREAD_SAFE TRTProcessingOfEndCapHits // Thread unsafe TRTParameters and TRTSensitiveDetector classes are used. { friend class TRTParametersForEndCapHits; diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx index cd207b7dfee78630e180cf01781b48217da97b66..db06ee735f9d6137200a1afc32428b43f803b477 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -70,7 +70,7 @@ TRTSensitiveDetector::TRTSensitiveDetector(const std::string& name, const std::s // Called by TRTSensitiveDetector // Once per run -void TRTSensitiveDetector::InitializeHitProcessing() +void TRTSensitiveDetector::InitializeHitProcessing ATLAS_NOT_THREAD_SAFE () // Thread unsafe TRTParametersForBarrelHits, TRTParametersForEndCapHits classes are used. { if(verboseLevel>4) { diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h index f95cc4f8776b1462b42bf40f724411a93643bbc7..50dfe58d5b82849cd8f696508b615a1a72f6578e 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRT_G4_SD_TRTSensitiveDetector_h @@ -8,6 +8,7 @@ // Base class #include "G4VSensitiveDetector.hh" +#include "CxxUtils/checker_macros.h" #include "InDetSimEvent/TRTUncompressedHitCollection.h" #include "StoreGate/WriteHandle.h" #include <gtest/gtest_prod.h> @@ -15,13 +16,12 @@ class TRTParameters; class TRTProcessingOfBarrelHits; class TRTProcessingOfEndCapHits; -class TRTOutputFile; class G4HCofThisEvent; class G4Step; class G4TouchableHistory; -class TRTSensitiveDetector : public G4VSensitiveDetector +class ATLAS_NOT_THREAD_SAFE TRTSensitiveDetector : public G4VSensitiveDetector // Thread unsafe TRTParameters, TRTProcessingOfBarrelHits, TRTProcessingOfEndCapHits classes is used. { FRIEND_TEST( TRTSensitiveDetectortest, Initialize); FRIEND_TEST( TRTSensitiveDetectortest, ProcessHits ); diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx index a871c236f7a98e7cd8a677c6db142b41ac4e27e4..d2d769c6f438130aa4b98db6be7c07efe7c0c297 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx +++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -18,7 +18,7 @@ TRTSensitiveDetectorTool::TRTSensitiveDetectorTool(const std::string& type, cons //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -G4VSensitiveDetector* TRTSensitiveDetectorTool::makeSD() const +G4VSensitiveDetector* TRTSensitiveDetectorTool::makeSD ATLAS_NOT_THREAD_SAFE () const // Thread unsafe TRTSensitiveDetector class is used. { ATH_MSG_DEBUG( "Initializing SD" ); diff --git a/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx b/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx index 13033f63ac6984b4ab4f0b424187ddb0667bcead..5d54bfeb834ec49ce33922d2c7677f048bfd5e0c 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx +++ b/InnerDetector/InDetG4/TRT_G4_SD/test/TRTSensitiveDetector_gtest.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "src/TRTSensitiveDetector.h" @@ -32,6 +32,8 @@ #include "G4AtlasTools/DerivedG4SensitiveDetectorTestSetting.h" #include "MCTruth/TrackHelper.h" +ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // Thread unsafe TRTSensitiveDetector class is tested in this unit test. + //set environment class GaudiEnvironment : public ::testing::Environment { protected: