BoundarySurface : Remove mutable, try to organise the access through members.
- Remove mutable
mutable const Tvol* m_insideVolume;
mutable const Tvol* m_outsideVolume;
mutable SharedObject<VolumeArray> m_insideVolumeArray;
mutable SharedObject<VolumeArray> m_outsideVolumeArray;
- These were accessed through "friendship" , in ways that were not 100% predictable when const objects are modified (which is not always nice for MT)
/** delcare the TrackingVolume Manipulator as friend */
friend class TrackingVolumeManipulator;
/** delcare the TrackingVolume as friend */
friend class TrackingVolume;
- So organised the access via getters/setters. As an example :
/** getters/setters for inside/outside Volume*/
Tvol const* insideVolume() const;
void setInsideVolume(const Tvol*);
void setInsideVolume ATLAS_NOT_CONST_THREAD_SAFE(const Tvol*) const ;
- The last one is for setting the
insideVolume
for aconst BoundarySurface
... One should not do this except if knows that is not const. In which case the non-const overload is better and provided. But we have quite a bit of code out there during the Tracking Geometry building that in reality deals with initially non-const objects which are then passed around as const (so safe but not nice). Mark the case asATLAS_NOT_CONST_THREAD_SAFE
so clients get notified if they run the ATLAS thread safety checker.
Edited by Christos Anastopoulos