diff --git a/Control/DataModelAthenaPool/DataModelAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/Control/DataModelAthenaPool/DataModelAthenaPool/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..14b383b29523cfb4241173beb13efb31905df9fe --- /dev/null +++ b/Control/DataModelAthenaPool/DataModelAthenaPool/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Control/DataModelAthenaPool diff --git a/Control/DataModelAthenaPool/src/DataVectorConvert.cxx b/Control/DataModelAthenaPool/src/DataVectorConvert.cxx index a477bbfa80d720beaeb3938e74ca1308bd8eb225..d77d5a7d07ac623d4107d885f94e378b42469014 100644 --- a/Control/DataModelAthenaPool/src/DataVectorConvert.cxx +++ b/Control/DataModelAthenaPool/src/DataVectorConvert.cxx @@ -14,6 +14,7 @@ #include "TClass.h" #include "TBuffer.h" #include "RootUtils/TClassEditRootUtils.h" +#include "CxxUtils/checker_macros.h" #include "TMemberStreamer.h" #include "TStreamerElement.h" #include "TStreamerInfo.h" @@ -26,6 +27,7 @@ #include <sstream> #include <cstring> #include <algorithm> +#include <mutex> namespace { @@ -421,10 +423,6 @@ void test_dv (RootUtils::ILogger* logfn, } -// List of classes we've already processed. -std::vector<TClass*> s_seen; - - } // anonymous namespace @@ -443,6 +441,12 @@ namespace DataModelAthenaPool { */ void DataVectorConvert::initialize (RootUtils::ILogger* logfn /* = 0*/) { + static std::mutex m; + std::lock_guard<std::mutex> lock (m); + + // List of classes we've already processed. + static std::vector<TClass*> s_seen ATLAS_THREAD_SAFE; + TIter next (gROOT->GetListOfClasses()); while (TClass* cls = dynamic_cast<TClass*> (next())) { if (std::strncmp (cls->GetName(), "DataVector<", 11) == 0) { diff --git a/Control/DataModelAthenaPool/test/DataLink_p2_test.cxx b/Control/DataModelAthenaPool/test/DataLink_p2_test.cxx index 4742e8673c6cc4ab1e97f2444214df5b772b63ff..e18e4cc013b290ee3e694c3e6a786f92f54a3b3f 100755 --- a/Control/DataModelAthenaPool/test/DataLink_p2_test.cxx +++ b/Control/DataModelAthenaPool/test/DataLink_p2_test.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 */ /** @@ -53,7 +53,7 @@ void test1() int main() { - SGTest::initTestStore(); + std::unique_ptr<SGTest::TestStore> testStore = SGTest::getTestStore(); test1(); return 0; } diff --git a/Control/DataModelAthenaPool/test/ElementLinkCnv_p1_test.cxx b/Control/DataModelAthenaPool/test/ElementLinkCnv_p1_test.cxx index ec296a8d0c99b3e5d85b6019e01433da244001ba..3e9c7ece8265b53c1d48e14c6edc88d216438038 100644 --- a/Control/DataModelAthenaPool/test/ElementLinkCnv_p1_test.cxx +++ b/Control/DataModelAthenaPool/test/ElementLinkCnv_p1_test.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 */ /** * @file DataModelAthenaPool/test/ElementLinkCnv_p1_test.cxx @@ -80,7 +80,7 @@ void test1() int main() { std::cout << "DataModelAthenaPool/ElementLinkCnv_p1_test\n"; - SGTest::initTestStore(); + std::unique_ptr<SGTest::TestStore> testStore = SGTest::getTestStore(); test1(); return 0; } diff --git a/Control/DataModelAthenaPool/test/ElementLinkCnv_p2_test.cxx b/Control/DataModelAthenaPool/test/ElementLinkCnv_p2_test.cxx index dc01dc059c165c59fd3f744cccac12a01d1d0b72..ec55ee671c8fe13d420c92bc114c07ac8db63700 100644 --- a/Control/DataModelAthenaPool/test/ElementLinkCnv_p2_test.cxx +++ b/Control/DataModelAthenaPool/test/ElementLinkCnv_p2_test.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 */ /** * @file DataModelAthenaPool/test/ElementLinkCnv_p2_test.cxx @@ -91,7 +91,7 @@ void test1() int main() { std::cout << "DataModelAthenaPool/ElementLinkCnv_p2_test\n"; - SGTest::initTestStore(); + std::unique_ptr<SGTest::TestStore> testStore = SGTest::getTestStore(); test1(); return 0; } diff --git a/Control/DataModelAthenaPool/test/ElementLinkCnv_p3_test.cxx b/Control/DataModelAthenaPool/test/ElementLinkCnv_p3_test.cxx index 795a532c36243a5dfe29709fd19cff79a369353a..5d46856bf331597319e65e87569fd13d46f1d71c 100644 --- a/Control/DataModelAthenaPool/test/ElementLinkCnv_p3_test.cxx +++ b/Control/DataModelAthenaPool/test/ElementLinkCnv_p3_test.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 */ /** * @file DataModelAthenaPool/test/ElementLinkCnv_p3_test.cxx @@ -77,7 +77,7 @@ void test1() int main() { std::cout << "DataModelAthenaPool/ElementLinkCnv_p3_test\n"; - SGTest::initTestStore(); + std::unique_ptr<SGTest::TestStore> testStore = SGTest::getTestStore(); test1(); return 0; } diff --git a/Control/DataModelAthenaPool/test/ElementLinkVectorCnv_p1_test.cxx b/Control/DataModelAthenaPool/test/ElementLinkVectorCnv_p1_test.cxx index c69f7d5efb53c1f2f81727a0fc69feb98e8999a8..e6dcd629e63dbd08e0d11fd873899661c669897d 100644 --- a/Control/DataModelAthenaPool/test/ElementLinkVectorCnv_p1_test.cxx +++ b/Control/DataModelAthenaPool/test/ElementLinkVectorCnv_p1_test.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 */ /** * @file DataModelAthenaPool/test/ElementLinkVectorCnv_p1_test.cxx @@ -109,7 +109,7 @@ void test1() int main() { std::cout << "DataModelAthenaPool/ElementLinkVectorCnv_p1_test\n"; - SGTest::initTestStore(); + std::unique_ptr<SGTest::TestStore> testStore = SGTest::getTestStore(); test1(); return 0; } diff --git a/Control/DataModelAthenaPool/test/NavigableCnv_p1_test.cxx b/Control/DataModelAthenaPool/test/NavigableCnv_p1_test.cxx index ae9e09c92bcb5e18d0d92a8fea166128a0676bdc..3c87cbb91ff2cea0414c4f6b3fe421758419588f 100644 --- a/Control/DataModelAthenaPool/test/NavigableCnv_p1_test.cxx +++ b/Control/DataModelAthenaPool/test/NavigableCnv_p1_test.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 */ /** * @file DataModelAthenaPool/test/NavigableCnv_p1_test.cxx @@ -150,7 +150,7 @@ void test2() int main() { std::cout << "DataModelAthenaPool/NavigableCnv_p1_test\n"; - SGTest::initTestStore(); + std::unique_ptr<SGTest::TestStore> testStore = SGTest::getTestStore(); test1(); test2(); return 0; diff --git a/Control/DataModelAthenaPool/test/NavigableCnv_p2_test.cxx b/Control/DataModelAthenaPool/test/NavigableCnv_p2_test.cxx index 38f160c4817f3a21361f82b1ddf1e59ac7ab01b7..bc264eefa9ecf267231278910d941789bcf2c478 100644 --- a/Control/DataModelAthenaPool/test/NavigableCnv_p2_test.cxx +++ b/Control/DataModelAthenaPool/test/NavigableCnv_p2_test.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 */ /** * @file DataModelAthenaPool/test/NavigableCnv_p2_test.cxx @@ -140,7 +140,7 @@ void test2() int main() { std::cout << "DataModelAthenaPool/NavigableCnv_p2_test\n"; - SGTest::initTestStore(); + std::unique_ptr<SGTest::TestStore> testStore = SGTest::getTestStore(); test1(); test2(); return 0; diff --git a/Control/DataModelAthenaPool/test/VectorElementLinkCnv_p1_test.cxx b/Control/DataModelAthenaPool/test/VectorElementLinkCnv_p1_test.cxx index 28c99b2e7bc478723ee66d8127c4e7fea4ed8520..5527c1009e526b40e775b03d4be08c5ad4edfd45 100644 --- a/Control/DataModelAthenaPool/test/VectorElementLinkCnv_p1_test.cxx +++ b/Control/DataModelAthenaPool/test/VectorElementLinkCnv_p1_test.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 */ /** * @file DataModelAthenaPool/test/VectorElementLinkCnv_p1_test.cxx @@ -102,7 +102,7 @@ void test1() int main() { std::cout << "DataModelAthenaPool/VectorElementLinkCnv_p1_test\n"; - SGTest::initTestStore(); + std::unique_ptr<SGTest::TestStore> testStore = SGTest::getTestStore(); test1(); return 0; } diff --git a/Tracking/TrkEventCnv/TrkEventCnvTools/TrkEventCnvTools/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEventCnv/TrkEventCnvTools/TrkEventCnvTools/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..19564ad5669afd068def701edd5fbf2b8b511501 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkEventCnvTools/TrkEventCnvTools/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkEventCnv/TrkEventCnvTools