On Tue, Aug 21, 2018 at 5:08 AM, Jeffrey Walton <noloader@xxxxxxxxx> wrote: > Hi everyone, > > I have some boilerplate call_once code that sets a few function pointers: > > std::once_flag s_flag; > InitializeInteger::InitializeInteger() > { > std::call_once(s_flag, []() { > SetFunctionPointers(); > }); > } Cancel... It looks like there are a lot of bad interactions with libstdc++, glibc and pthreads. Cf., https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66146. We are going to move onto to something else. Since we are only writing function pointers an old doubled-checked init should work fine. It does not matter if the function pointer gets written twice during the first race (if it occurs). Jeff