Example of Singleton mode with multithreads in c++