Suppose there is a function :
Obj* Obj::instance()
{
static Obj obj;
return &obj;
}
As we known that obj will be initialized when Obj::instance has been called for the first time. But what will happen if multiple thread call this function concurrently?