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