static void Main(string[] args)
        {
            SingleThread1 instance1 = SingleThread1.instance;
            SingleThread2 instance2 = SingleThread2.GetInstance();

            MultiThread instance = MultiThread.Instance;
        }
示例#2
0
 public static SingleThread2 GetInstance()
 {
     if (instance == null)
     {
         instance = new SingleThread2();
     }
     return(instance);
 }