17 Oct
2008
17 Oct
'08
3:12 a.m.
On Thursday 16 October 2008 22:56, Frank Mori Hess wrote:
Hmm, so I guess it is impossible to make a thread-safe singleton that avoids the static initialization order fiasco, unless your compiler guarantees thread-safe initialization of local statics. Even boost::call_once would require the once_flag to be statically initialized before the call_once call happens.
Err, nevermind. Apparently static POD types (once_flag) are guaranteed to be initialized before any constructors are run.