Beispiel #1
0
 public static Singleton2 GetInstance()
 {
     if (instance == null)
     {
         lock (myLock)
         {
             if (instance == null)
             {
                 instance = new Singleton2();
             }
         }
     }
     return(instance);
 }
Beispiel #2
0
 public static Singleton2 GetInstance()
 {
     if (instance == null)
     {
         lock (myLock)
         {
             if (instance == null)
                 instance = new Singleton2();
         }
     }
     return instance;
 }