1 public class SingleInstance
 2 {
 3     private static SingleInstance singleInstance = null;
 4     private static readonly object locker = new object();
 5     private SingleInstance()
 6     { 
 7     }
 8     public static SingleInstance getInstance()
 9     {
10         lock (locker)
11         {
12             if (singleInstance == null)
13                 return new SingleInstance();
14         }
15         return singleInstance;
16     }
17 }