Skip to content

WIP: Make sure s_curCtx() is called once at libary load to init the TLS

Marco Clemencic requested to merge clemenci/Gaudi:fix-possible-data-race into master

helgrind reported a possible data race in setCurrentContext and the only explanation we found is that the first call to s_curCtx() is not thread safe because it has to initialize the static TLS structure.

This MR ensures that the TLS is initialized at library load, preventing the data race.

/cc @sponce

Edited by Marco Clemencic

Merge request reports