From def6b26bcc8627bfd16395020a6074c259168eac Mon Sep 17 00:00:00 2001 From: scott snyder <sss@karma> Date: Fri, 16 Oct 2020 17:02:28 -0400 Subject: [PATCH] LArRawUtils: Enable thread-safety checking. Enable thread-safety checking. Mark LArRoI_Map/LArRawOrdering as not thread-safe, as they use old cabling tools + callbacks. --- LArCalorimeter/LArRawUtils/CMakeLists.txt | 2 +- .../LArRawUtils/LArRawUtils/ATLAS_CHECK_THREAD_SAFETY | 1 + LArCalorimeter/LArRawUtils/LArRawUtils/LArRawOrdering.h | 7 ++++--- LArCalorimeter/LArRawUtils/LArRawUtils/LArRoI_Map.h | 9 ++++++--- LArCalorimeter/LArRawUtils/LArRawUtils/LArTT_Selector.h | 9 ++++++--- .../LArRawUtils/LArRawUtils/LArTT_Selector.icc | 4 ++-- 6 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 LArCalorimeter/LArRawUtils/LArRawUtils/ATLAS_CHECK_THREAD_SAFETY diff --git a/LArCalorimeter/LArRawUtils/CMakeLists.txt b/LArCalorimeter/LArRawUtils/CMakeLists.txt index 1eacf72f7c56..7bcf7e2e66b2 100644 --- a/LArCalorimeter/LArRawUtils/CMakeLists.txt +++ b/LArCalorimeter/LArRawUtils/CMakeLists.txt @@ -7,7 +7,7 @@ atlas_subdir( LArRawUtils ) atlas_add_library( LArRawUtilsLib src/*.cxx PUBLIC_HEADERS LArRawUtils - LINK_LIBRARIES CaloIdentifier CaloTTDetDescr AthenaBaseComps AthenaKernel Identifier GaudiKernel LArCablingLib LArIdentifier LArRawEvent StoreGateLib CaloTriggerToolLib + LINK_LIBRARIES CaloIdentifier CaloTTDetDescr AthenaBaseComps AthenaKernel Identifier GaudiKernel LArCablingLib LArIdentifier LArRawEvent StoreGateLib CaloTriggerToolLib CxxUtils PRIVATE_LINK_LIBRARIES AtlasDetDescr ) atlas_add_component( LArRawUtils diff --git a/LArCalorimeter/LArRawUtils/LArRawUtils/ATLAS_CHECK_THREAD_SAFETY b/LArCalorimeter/LArRawUtils/LArRawUtils/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 000000000000..b64f7f52b512 --- /dev/null +++ b/LArCalorimeter/LArRawUtils/LArRawUtils/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +LArCalorimeter/LArRawUtils diff --git a/LArCalorimeter/LArRawUtils/LArRawUtils/LArRawOrdering.h b/LArCalorimeter/LArRawUtils/LArRawUtils/LArRawOrdering.h index 68ce79f0b7ab..6f6f5e62394e 100755 --- a/LArCalorimeter/LArRawUtils/LArRawUtils/LArRawOrdering.h +++ b/LArCalorimeter/LArRawUtils/LArRawUtils/LArRawOrdering.h @@ -1,17 +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 LARRAWUTILS_LARRAWORDERING_H #define LARRAWUTILS_LARRAWORDERING_H -#include "LArRawEvent/LArRawChannel.h" +#include "LArRawEvent/LArRawChannel.h" +#include "CxxUtils/checker_macros.h" class LArRoI_Map; -class LArRawOrdering +class ATLAS_NOT_THREAD_SAFE LArRawOrdering { public: diff --git a/LArCalorimeter/LArRawUtils/LArRawUtils/LArRoI_Map.h b/LArCalorimeter/LArRawUtils/LArRawUtils/LArRoI_Map.h index 4d1c4aff5299..4e5b383741dd 100644 --- a/LArCalorimeter/LArRawUtils/LArRawUtils/LArRoI_Map.h +++ b/LArCalorimeter/LArRawUtils/LArRawUtils/LArRoI_Map.h @@ -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 */ #ifndef LARRAWEVENT_LARROI_MAP_H @@ -16,6 +16,7 @@ #include "StoreGate/DataHandle.h" #include "GaudiKernel/IIncidentListener.h" #include "AthenaKernel/IOVSvcDefs.h" +#include "CxxUtils/checker_macros.h" #include "AthenaBaseComps/AthAlgTool.h" #include <map> @@ -36,8 +37,10 @@ class LArFCAL_ID ; */ -class LArRoI_Map : public AthAlgTool, - public IIncidentListener +// Not thread-safe due to the use of old cabling tools + callbacks +class ATLAS_NOT_THREAD_SAFE + LArRoI_Map : public AthAlgTool, + public IIncidentListener { public: diff --git a/LArCalorimeter/LArRawUtils/LArRawUtils/LArTT_Selector.h b/LArCalorimeter/LArRawUtils/LArRawUtils/LArTT_Selector.h index 05701fea0b06..4f8251731133 100755 --- a/LArCalorimeter/LArRawUtils/LArRawUtils/LArTT_Selector.h +++ b/LArCalorimeter/LArRawUtils/LArRawUtils/LArTT_Selector.h @@ -1,15 +1,17 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef LARRAWUTILS_LARTT_SELECTOR_H #define LARRAWUTILS_LARTT_SELECTOR_H #include "Identifier/Identifier.h" -#include "Identifier/IdentifierHash.h" +#include "Identifier/IdentifierHash.h" +#include "CxxUtils/checker_macros.h" class LArRoI_Map; +// Not thread-safe due to the use of LArRoI_Map. template <class CONTAINER > class LArTT_Selector { @@ -95,7 +97,8 @@ class LArTT_Selector // set RoI according TT, + a sam number. // void setRoIs( const VEC_TT_ID& ids, int sam ) ; - void setRoIs( const VEC_TT_ID& ids ) ; + // Not thread-safe due to the use of LArRoI_Map. + void setRoIs ATLAS_NOT_THREAD_SAFE ( const VEC_TT_ID& ids ) ; // set RoI according to combined TT_Sampling ID (unsigned int). // void setRoIs( const VEC_TT_SAM_ID& ids ) ; diff --git a/LArCalorimeter/LArRawUtils/LArRawUtils/LArTT_Selector.icc b/LArCalorimeter/LArRawUtils/LArRawUtils/LArTT_Selector.icc index 88e6da0f0290..d4bf18ecd92b 100755 --- a/LArCalorimeter/LArRawUtils/LArRawUtils/LArTT_Selector.icc +++ b/LArCalorimeter/LArRawUtils/LArRawUtils/LArTT_Selector.icc @@ -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 "LArRawUtils/LArRoI_Map.h" @@ -150,7 +150,7 @@ void LArTT_Selector<CONTAINER>::setContainer(const CONTAINER* c) { template <class CONTAINER > //void LArTT_Selector<CONTAINER> :: setRoIs( const VEC_TT_ID& ids, // int sam) -void LArTT_Selector<CONTAINER> :: setRoIs( const VEC_TT_ID& ids) +void LArTT_Selector<CONTAINER> :: setRoIs ATLAS_NOT_THREAD_SAFE ( const VEC_TT_ID& ids) { // clean it up. -- GitLab