diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt b/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt index 2403ae0ca656e2f34f84ced9e38015f9a251537b..7189431e704742a9798d7a81f9e04437cce06c3d 100644 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt @@ -24,6 +24,7 @@ atlas_depends_on_subdirs( PUBLIC InnerDetector/InDetConditions/TRT_ConditionsData PRIVATE Control/AthenaBaseComps + Control/CxxUtils Control/StoreGate Database/AthenaPOOL/AthenaPoolUtilities Database/RDBAccessSvc @@ -51,11 +52,11 @@ atlas_add_library( TRT_ConditionsServicesLib PUBLIC_HEADERS TRT_ConditionsServices PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} LINK_LIBRARIES AthenaKernel GeoPrimitives EventPrimitives GaudiKernel TRT_ConditionsData StoreGateLib SGtests InDetConditionsSummaryService - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} AthenaBaseComps AthenaPoolUtilities DetDescrConditions GeoModelUtilities Identifier xAODEventInfo InDetCoolCoralClientUtils InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry PathResolver RegistrationServicesLib ${extra_lib} RDBAccessSvcLib ) + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} AthenaBaseComps CxxUtils AthenaPoolUtilities DetDescrConditions GeoModelUtilities Identifier xAODEventInfo InDetCoolCoralClientUtils InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry PathResolver RegistrationServicesLib ${extra_lib} RDBAccessSvcLib ) atlas_add_component( TRT_ConditionsServices src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} AthenaKernel GeoPrimitives EventPrimitives GaudiKernel TRT_ConditionsData AthenaBaseComps StoreGateLib SGtests AthenaPoolUtilities DetDescrConditions GeoModelUtilities Identifier xAODEventInfo EventInfo InDetCoolCoralClientUtils InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry PathResolver TRT_ConditionsServicesLib InDetConditionsSummaryService ${extra_lib} RegistrationServicesLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} AthenaKernel GeoPrimitives EventPrimitives GaudiKernel TRT_ConditionsData AthenaBaseComps CxxUtils StoreGateLib SGtests AthenaPoolUtilities DetDescrConditions GeoModelUtilities Identifier xAODEventInfo EventInfo InDetCoolCoralClientUtils InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry PathResolver TRT_ConditionsServicesLib InDetConditionsSummaryService ${extra_lib} RegistrationServicesLib ) atlas_install_python_modules( python/*.py ) diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/TRT_ConditionsServices/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/TRT_ConditionsServices/TRT_ConditionsServices/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..11c23b9daabe0d3c9392a3844f18b63008a2280e --- /dev/null +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/TRT_ConditionsServices/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +InnerDetector/InDetConditions/TRT_ConditionsServices diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_AlignDbSvc.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_AlignDbSvc.cxx index fb0ca3d2e5691156b6b7846bd2855f3554c96bd7..13b0318737b63b958972319cf0ed5aa68bd4ed96 100755 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_AlignDbSvc.cxx +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_AlignDbSvc.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 */ /** @file TRT_AlignDbSvc.cxx @@ -32,6 +32,8 @@ #include "GeoPrimitives/CLHEPtoEigenConverter.h" #include "GeoPrimitives/CLHEPtoEigenEulerAnglesConverters.h" +ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // This class uses const_cast and regFcn (callback). Legacy code + TRT_AlignDbSvc::TRT_AlignDbSvc( const std::string& name, ISvcLocator* pSvcLocator ) : AthService(name,pSvcLocator), m_detStore("DetectorStore",name), diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_AlignDbSvc.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_AlignDbSvc.h index 50297b748737013a4318279ef1147814017e2db6..e415d828d4ffd60c8068a2f36cf40449324e058a 100755 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_AlignDbSvc.h +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_AlignDbSvc.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_ALIGNDBSVC_H @@ -22,6 +22,7 @@ #include <vector> #include "AthenaBaseComps/AthService.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ToolHandle.h" #include "StoreGate/DataHandle.h" #include "TRT_ConditionsServices/ITRT_AlignDbSvc.h" @@ -30,6 +31,8 @@ #include "GaudiKernel/ServiceHandle.h" #include "StoreGate/StoreGateSvc.h" +ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // This class uses const_cast. Legacy code + namespace InDetDD { class TRT_DetectorManager ; } diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.h index 4ffee3baf73795a9e2d5b8b56e745b059cfeaa08..a819c22180fd42c838510efe118c6d48068cfd34 100644 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.h +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.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 TRT_CALDBTOOL_H @@ -20,7 +20,6 @@ #include "GaudiKernel/ICondSvc.h" // Storegate #include "StoreGate/ReadCondHandleKey.h" -#include "StoreGate/DataHandle.h" //Athena #include "AthenaBaseComps/AthAlgTool.h" // TRT diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DCS_ConditionsSvc.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DCS_ConditionsSvc.h index 3195d4a9b5d15ef85cf56dba727c709c02e3977c..0749d168c0052793223d59d3451fbe1c15197558 100755 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DCS_ConditionsSvc.h +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_DCS_ConditionsSvc.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_DCS_CONDITIONSSVC_H @@ -12,6 +12,7 @@ **/ #include <vector> #include "AthenaBaseComps/AthService.h" +#include "CxxUtils/checker_macros.h" #include "TRT_ConditionsServices/ITRT_DCS_ConditionsSvc.h" #include "TRT_ConditionsServices/ITRT_ConditionsSvc.h" #include "AthenaBaseComps/AthService.h" @@ -101,13 +102,13 @@ class TRT_DCS_ConditionsSvc : public AthService, SG::ReadCondHandleKey<CondAttrListCollection> m_barrelReadKey{this,"BarrelKeyName","in","HV Barrel in-key"}; SG::ReadCondHandleKey<CondAttrListCollection> m_EAReadKey{this,"EAKeyName","in","HV EA in-key"}; SG::ReadCondHandleKey<CondAttrListCollection> m_ECReadKey{this,"ECKeyName","in","HV EC in-key"}; - mutable std::vector<const CondAttrListCollection*> m_Barrel_HV_COOLCont; - mutable std::vector<const CondAttrListCollection*> m_EndcapA_HV_COOLCont; - mutable std::vector<const CondAttrListCollection*> m_EndcapC_HV_COOLCont; + mutable std::vector<const CondAttrListCollection*> m_Barrel_HV_COOLCont ATLAS_THREAD_SAFE; // Guarded by m_cacheMutex + mutable std::vector<const CondAttrListCollection*> m_EndcapA_HV_COOLCont ATLAS_THREAD_SAFE; // Guarded by m_cacheMutex + mutable std::vector<const CondAttrListCollection*> m_EndcapC_HV_COOLCont ATLAS_THREAD_SAFE; // Guarded by m_cacheMutex mutable std::mutex m_cacheMutex; - mutable std::vector<EventContext::ContextEvt_t> m_evtBA; - mutable std::vector<EventContext::ContextEvt_t> m_evtEA; - mutable std::vector<EventContext::ContextEvt_t> m_evtEC; + mutable std::vector<EventContext::ContextEvt_t> m_evtBA ATLAS_THREAD_SAFE; // Guarded by m_cacheMutex + mutable std::vector<EventContext::ContextEvt_t> m_evtEA ATLAS_THREAD_SAFE; // Guarded by m_cacheMutex + mutable std::vector<EventContext::ContextEvt_t> m_evtEC ATLAS_THREAD_SAFE; // Guarded by m_cacheMutex int m_IOVmaxLength; bool m_doIOVchecking; diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawAlignDbSvc.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawAlignDbSvc.cxx index c0126aa78ab232802e4288eeaf13411c28eb6c06..936225464f2762baa74a30980dd422e68433bf79 100755 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawAlignDbSvc.cxx +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawAlignDbSvc.cxx @@ -22,6 +22,7 @@ #include "Identifier/Identifier.h" #include "TRT_ReadoutGeometry/TRT_DetectorManager.h" +ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // This class uses const_cast, regFcn (callback) and DataHandle. Legacy code TRT_StrawAlignDbSvc::TRT_StrawAlignDbSvc( const std::string& name, ISvcLocator* pSvcLocator ) diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawAlignDbSvc.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawAlignDbSvc.h index 9a0b2b96423290ee6b85578349047f19854dc16e..b7f5e9279ebf3c411cf8599457c1595e40cc4429 100755 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawAlignDbSvc.h +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawAlignDbSvc.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_STRAWALIGNDBSVC_H @@ -11,6 +11,7 @@ #include <vector> #include "AthenaBaseComps/AthService.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ToolHandle.h" #include "StoreGate/DataHandle.h" #include "InDetIdentifier/TRT_ID.h" @@ -19,6 +20,8 @@ #include "StoreGate/StoreGateSvc.h" #include "GaudiKernel/ServiceHandle.h" +ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // This class uses const_cast, regFcn (callback) and DataHandle. Legacy code + class IAthenaOutputStreamTool ; namespace InDetDD { class TRT_DetectorManager ; diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx index 93277e853700e129c46d3f4745df47902cbde65c..2827547aac9c5ba4a85f8c497dfd0d9c0b6afd5f 100644 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx @@ -12,7 +12,6 @@ #include "TRT_StrawStatusSummaryTool.h" #include "InDetIdentifier/TRT_ID.h" - TRT_StrawStatusSummaryTool::TRT_StrawStatusSummaryTool( const std::string& type, const std::string& name, const IInterface* parent) : base_class(type, name, parent), m_condSvc("CondSvc",name) {} @@ -94,7 +93,7 @@ int TRT_StrawStatusSummaryTool::getStatusHT(Identifier offlineID, const EventCon const StrawStatusContainer* strawstatusHTcontainer; if(m_isGEANT4) { - strawstatusHTcontainer=m_strawstatusHTG4.cptr(); + strawstatusHTcontainer=m_strawstatusHTG4.cptr(); } else { SG::ReadCondHandle<StrawStatusContainer> rht(m_statHTReadKey,ctx); @@ -108,7 +107,7 @@ const TRTCond::StrawStatusMultChanContainer* TRT_StrawStatusSummaryTool::getStra const StrawStatusContainer* strawstatusHTcontainer; if(m_isGEANT4) { - strawstatusHTcontainer=m_strawstatusHTG4.cptr(); + strawstatusHTcontainer=m_strawstatusHTG4.cptr(); } else { SG::ReadCondHandle<StrawStatusContainer> rht(m_statHTReadKey,Gaudi::Hive::currentContext()); diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.h index 5d6bfc71a79ade996856b25891b3b122f081e612..e9baa4b200ba2a2bade19b7df71b61c30eed15fd 100644 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.h +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.h @@ -26,7 +26,12 @@ #include "TRT_ConditionsData/StrawStatusMultChanContainer.h" -class TRT_StrawStatusSummaryTool: public extends<AthAlgTool, ITRT_StrawStatusSummaryTool> +#include "CxxUtils/checker_macros.h" + +class ATLAS_NOT_THREAD_SAFE TRT_StrawStatusSummaryTool: // This class uses thread-unsafe DataHandle (m_strawstatusHTG4). +// If bare pointer is used, GeoModelSvc.TRT_DetectorTool.TRT_StrawStatusSummaryTool +// cannot retrieve folder 'SimStatusHTKey':/TRT/Cond/StatusHT + public extends<AthAlgTool, ITRT_StrawStatusSummaryTool> { public: typedef TRTCond::StrawStatusMultChanContainer StrawStatusContainer;