Hi!
According to following resources, in C++(Specially Visual C++) scoped static variable initialization isn't thread safe. But, global static variables are safe.
http://stackoverflow.com/questions/1052168/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!