public static SingletonLazySafety GetInstance() { if (instance == null) { lock (syncObject) { if (instance == null) { instance = new SingletonLazySafety(); } } } return(instance); }
static void SingletonDemo() { SingletonLazySafety instance = SingletonLazySafety.GetInstance(); }