diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkTrack/TrkTrack/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..697944f1d7ec82ede1bb3a020af44e042315b68f --- /dev/null +++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkEvent/TrkTrack diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.h b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.h index eb5335bd172954a2d70853a7c4507bffa9312fe1..b5c1f8c7bee3282a5026c3a36b2b7dcf8bb75762 100755 --- a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.h +++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackStateOnSurface.h @@ -17,6 +17,7 @@ email : edward.moyse@cern.ch #include "TrkEventPrimitives/FitQualityOnSurface.h" #include "TrkMaterialOnTrack/MaterialEffectsBase.h" #include "TrkParameters/TrackParameters.h" +#include "CxxUtils/checker_macros.h" class MsgStream; @@ -268,13 +269,13 @@ namespace Trk * Use this method to set persistification hints. * @throw logic_error if the type is not a persistification flag. */ - void setHint( const TrackStateOnSurfaceType& type ) const; + void setHint ATLAS_NOT_THREAD_SAFE ( const TrackStateOnSurfaceType& type ) const; /** * Use this method to clear persistification hint flag. * @throw logic_error if the type is not a persistification flag. */ - void resetHint( const TrackStateOnSurfaceType& type ) const; + void resetHint ATLAS_NOT_THREAD_SAFE ( const TrackStateOnSurfaceType& type ) const; /** returns a string with the expanded type of the object (i.e. if it has several type bits set, they all will be returned)*/ @@ -313,7 +314,7 @@ namespace Trk const MeasurementBase *m_measurementOnTrack; const MaterialEffectsBase *m_materialEffectsOnTrack; const AlignmentEffectsOnTrack *m_alignmentEffectsOnTrack; - mutable std::bitset<NumberOfTrackStateOnSurfaceTypes> m_typeFlags; + std::bitset<NumberOfTrackStateOnSurfaceTypes> m_typeFlags; }; /**Overload of << operator for MsgStream for debug output*/ diff --git a/Tracking/TrkEvent/TrkTrack/src/TrackStateOnSurface.cxx b/Tracking/TrkEvent/TrkTrack/src/TrackStateOnSurface.cxx index ca1295e7b37c6157ae5931c1f2b6db50cf3c00c5..d712a1aac3147a3c045e71da0fcc4b4f4974b07f 100755 --- a/Tracking/TrkEvent/TrkTrack/src/TrackStateOnSurface.cxx +++ b/Tracking/TrkEvent/TrkTrack/src/TrackStateOnSurface.cxx @@ -235,20 +235,24 @@ TrackStateOnSurface::isSane() const { } - void TrackStateOnSurface::setHint( const TrackStateOnSurfaceType& type ) const { + void TrackStateOnSurface::setHint ATLAS_NOT_THREAD_SAFE ( const TrackStateOnSurfaceType& type ) const { if (type>=PartialPersistification && type<=PersistifySlimCaloDeposit) { // allowed to modify persistification flags although this is const - m_typeFlags.set(type); + + /* Fixing this needs revisiting the slimming code*/ + (const_cast< std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>&> (this->m_typeFlags)).reset(type); } else { throw std::logic_error("Can only use TrackStateOnSurface::mark to set persistification flags"); } } - void TrackStateOnSurface::resetHint( const TrackStateOnSurfaceType& type ) const { + void TrackStateOnSurface::resetHint ATLAS_NOT_THREAD_SAFE ( const TrackStateOnSurfaceType& type ) const { if (type>=PartialPersistification && type<=PersistifySlimCaloDeposit) { // allowed to modify persistification flags although this is const - m_typeFlags.reset(type); + + /* Fixing this needs revisiting the slimming code*/ + (const_cast< std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>&> (this->m_typeFlags)).reset(type); } else { throw std::logic_error("Can only use TrackStateOnSurface::mark to set persistification flags");