The usual pattern for a singleton class is something like
static Foo &getInst() { static Foo *inst = NULL; if(inst == NULL) inst = new Foo(...);
Your alternative is called "double-checked locking".
There could exist multi-threaded memory models in which it works, but POSIX does not guarantee one