According to following resources, in C++(Specially Visual C++) scoped static variable initialization isn't thread safe. But, global static variables are safe.
Thread-safe static variables without mutexing?
http://blogs.msdn.com/oldnewthing/archive/2004/03/08/85901.aspx
So, is following code with static member variable thread-safe?
class TestClass { public: static MyClass m_instance; } Myclass TestClass::m_instance; Thanks in advance!