diff --git a/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..e1b32832e1df2187568ca1ea2047fcbfe8dcb91b --- /dev/null +++ b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkEvent/TrkParametersIdentificationHelpers diff --git a/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/TrackParametersIdHelper.h b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/TrackParametersIdHelper.h index 8beb6d795e121823a1e5fc30d3b74d8579529e64..9071a81f06fd07bc98de125a45275ef399b40d1c 100644 --- a/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/TrackParametersIdHelper.h +++ b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/TrackParametersIdHelper.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TRK_TRACKPARAMETERSIDHELPER_H @@ -45,13 +45,13 @@ namespace Trk { /** set version bits */ void setVersion( TrackParametersIdentifier& id ) const; - static unsigned int m_version; - static BitField<unsigned int> m_validField; - static BitField<unsigned int> m_versionField; - static BitField<unsigned int> m_technologyField; + static const unsigned int m_version; + static const BitField<unsigned int> m_validField; + static const BitField<unsigned int> m_versionField; + static const BitField<unsigned int> m_technologyField; - static BitField<unsigned int> m_isEntryToLayerField; - static BitField<unsigned int> m_caloSamplingField; + static const BitField<unsigned int> m_isEntryToLayerField; + static const BitField<unsigned int> m_caloSamplingField; }; diff --git a/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/TrackParametersIdentificationHelper.h b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/TrackParametersIdentificationHelper.h index a3e51ce7f8d0a6e56db41bad63542787f63cc3d5..2ade198c660e5fd7838647898fc5f0f9a4ccb30a 100644 --- a/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/TrackParametersIdentificationHelper.h +++ b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/TrkParametersIdentificationHelpers/TrackParametersIdentificationHelper.h @@ -24,7 +24,7 @@ namespace Trk { private: - static TrackParametersIdHelper m_helper; + static const TrackParametersIdHelper m_helper; }; inline TrackParametersIdentifier TrackParametersIdentificationHelper::getIdentifier( const CurvilinearParameters& pars ) { diff --git a/Tracking/TrkEvent/TrkParametersIdentificationHelpers/src/TrackParametersIdHelper.cxx b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/src/TrackParametersIdHelper.cxx index 47e4fa19c97232439ef5f571daeeb30a2849ea09..5688a2e779de408792426cc5d40bb5906f90af49 100644 --- a/Tracking/TrkEvent/TrkParametersIdentificationHelpers/src/TrackParametersIdHelper.cxx +++ b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/src/TrackParametersIdHelper.cxx @@ -6,14 +6,14 @@ namespace Trk { - unsigned int TrackParametersIdHelper::m_version = 0; - BitField<unsigned int> TrackParametersIdHelper::m_validField( 31, 1 ); + const unsigned int TrackParametersIdHelper::m_version = 0; + const BitField<unsigned int> TrackParametersIdHelper::m_validField( 31, 1 ); - BitField<unsigned int> TrackParametersIdHelper::m_versionField( 28, 3 ); - BitField<unsigned int> TrackParametersIdHelper::m_technologyField( 23, 5 ); + const BitField<unsigned int> TrackParametersIdHelper::m_versionField( 28, 3 ); + const BitField<unsigned int> TrackParametersIdHelper::m_technologyField( 23, 5 ); - BitField<unsigned int> TrackParametersIdHelper::m_isEntryToLayerField( 5, 2 ); - BitField<unsigned int> TrackParametersIdHelper::m_caloSamplingField( 0, 5 ); + const BitField<unsigned int> TrackParametersIdHelper::m_isEntryToLayerField( 5, 2 ); + const BitField<unsigned int> TrackParametersIdHelper::m_caloSamplingField( 0, 5 ); } diff --git a/Tracking/TrkEvent/TrkParametersIdentificationHelpers/src/TrackParametersIdentificationHelper.cxx b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/src/TrackParametersIdentificationHelper.cxx index 885df862fb64a3904baf706e90bced55cc538a5d..abf232169a31cf84f94bdb818120dd4e480dc5e5 100644 --- a/Tracking/TrkEvent/TrkParametersIdentificationHelpers/src/TrackParametersIdentificationHelper.cxx +++ b/Tracking/TrkEvent/TrkParametersIdentificationHelpers/src/TrackParametersIdentificationHelper.cxx @@ -6,7 +6,7 @@ namespace Trk { - TrackParametersIdHelper TrackParametersIdentificationHelper::m_helper; + const TrackParametersIdHelper TrackParametersIdentificationHelper::m_helper; TrackParametersIdentifier TrackParametersIdentificationHelper::getIdentifier( const Trk::TrackParameters& pars ) { const CurvilinearParameters* cpars = dynamic_cast<const CurvilinearParameters*>(&pars); diff --git a/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..bd481a300f362870c7cc9e93c7a2f103d823cdff --- /dev/null +++ b/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkEvent/TrkRIO_OnTrack diff --git a/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrack.h b/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrack.h index a64f1f0076d9fb7bbf6bbe44569e43f949d5fb24..fdd1e0aa5a5dce68ba54d11d27297895c4ae2bf1 100755 --- a/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrack.h +++ b/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrack.h @@ -19,6 +19,8 @@ #include "Identifier/Identifier.h" #include "Identifier/IdentifierHash.h" #include <ostream> +#include <atomic> + class MsgStream; class RIO_OnTrackCnv_p1; class RIO_OnTrackCnv_p2; @@ -125,7 +127,7 @@ namespace Trk { Identifier m_identifier; /** number of objects of this type in memory */ - static unsigned int s_numberOfInstantiations; + static std::atomic<unsigned int> s_numberOfInstantiations; }; inline Identifier RIO_OnTrack::identify() const diff --git a/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrack.cxx b/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrack.cxx index 0ca60d1014cd3659fe32dc7ac2ecfcb94db429b9..d644caf8e4a75bbec8f2cae2fad8b9069ed1373c 100755 --- a/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrack.cxx +++ b/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrack.cxx @@ -17,7 +17,7 @@ #include <string> #include <typeinfo> -unsigned int Trk::RIO_OnTrack::s_numberOfInstantiations=0; +std::atomic<unsigned int> Trk::RIO_OnTrack::s_numberOfInstantiations{0}; // Constructor with parameters: Trk::RIO_OnTrack::RIO_OnTrack( const Trk::LocalParameters& locpars, diff --git a/Tracking/TrkEvent/TrkTrackLink/TrkTrackLink/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkTrackLink/TrkTrackLink/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..9f602e25beb506c82bcc5a476e0e6afd45789a1a --- /dev/null +++ b/Tracking/TrkEvent/TrkTrackLink/TrkTrackLink/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkEvent/TrkTrackLink