Is C++ static member variable initialization thread-safe?
问题 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! 回答1: It's more a question of function-scoped static