
17 Nov
2012
17 Nov
'12
11:24 p.m.
John, perhaps not what you're looking for since you mention you need to support multiple platforms, but just in case; gcc will automatically emit code in order to make functional local static initialization thread-safe. This feature is on by default, but can be explicitly disabled: -fno-threadsafe-statics Do not emit the extra code to use the routines specified in the C++ ABI for thread-safe initialization of local statics. You can use this option to reduce code size slightly in code that doesn't need to be thread-safe.