static MySingleton& getInstance(){ if ( !instance ){ // check lock_guard myLock(myMutex); // lock if( !instance ) instance= new MySingleton(); // check return *instance; } }