static MySingleton* getInstance(){ MySingleton* sin = instance.load(std::memory_order_acquire); if (!sin){ std::lock_guard myLock(myMutex); sin = instance.load(std::memory_order_relaxed); if (!sin){ sin = new MySingleton(); instance.store(sin, std::memory_order_release); } } volatile int dummy{}; return sin; }