Firstly, you have a spelling error... it is "Singleton".
Solution 2 is correct that you should check the static instance pointer and not a flag.
Neither of these choices is threadsafe. If you have more than one thread, you need to protect the first instance creation with a critical section.
Since the stated language desired is C++, you can define the static instance in the get_instance() method:
Singelton* Singelton::get_instance()
{
static Singelton* pThis;
if(!pThis)
{
pThis = new Singelton();
}
return s_instance_p;
}
If the app is multithreaded, the 'if' statement needs to have critical section backup.
You can't use this technique in java or several other languages.