Skip to content

Ensure thread local initialization is always done

Charles Leggett requested to merge leggett/Gaudi:dev/master/initThread into master

tbb will sometimes create new threads long after the job has started. This means that any thread local initialization performed by ThreadInitTools at the start of the job will not be present in the new threads. This can be catastrophic for things like G4.

We detect this by checking a thread local variable at the start of AlgoExecutionTask, which is normally set by the ThreadInitTask at the start of the job. If it's unset, the ThreadInitTasks are re-triggered for the executing thread.

I kept the thread local variable inside of GaudiHive instead of putting a more generic interface in GaudiKernel, as I didn't want the penalty of having to access it in another shared lib.

Merge request reports