Skip to content

Add ATLAS_THREAD_SAFETY_CHECKER to CaloConditions

The MR adds the ATLAS_THREAD_SAFETY_CHECKER to CaloConditions

There was a single issue (which is slightly interesting since one prb would expect 0 / and this has to be 0) The checker was complaining on

static' expression 'boost::{anonymous}::extents' of type 'boost::multi_array_types::extent_gen 
...goes bit longer... ....
within function 
'CaloNoise::CaloNoise(size_t, size_t, size_t, size_t, const CaloCell_Base_ID*, CaloNoise::NOISETYPE)';
 may not be thread-safe

The simple version of it being that https://www.boost.org/doc/libs/1_72_0/libs/multi_array/doc/reference.html

Boost.MultiArray's array classes use the extents global object to specify array shape during their construction. For example, a 3 by 3 by 3 multi_array is constructed as follows:

multi_array<int,3> A(extents[3][3][3]);

The same array could also be created by explicitly declaring an extent_gen object locally,, but the global object makes this declaration unnecessary.

The thread safety checker rather prefers not using the global object. Obviously all is fine if a local is employed.

One could consider disabling the global objects by

#ifndef BOOST_MULTI_ARRAY_NO_GENERATORS

if they become an issue ....

Edited by Christos Anastopoulos

Merge request reports

Loading