Exemplo n.º 1
0
 public static SingletonLazySafety GetInstance()
 {
     if (instance == null)
     {
         lock (syncObject)
         {
             if (instance == null)
             {
                 instance = new SingletonLazySafety();
             }
         }
     }
     return(instance);
 }
Exemplo n.º 2
0
 static void SingletonDemo()
 {
     SingletonLazySafety instance = SingletonLazySafety.GetInstance();
 }