static void TestSingleInstance() { Task[] taskArray = new Task[100]; for (int i = 0; i < 100; i++) { taskArray[i] = Task.Factory.StartNew(() => { SingleInstance.TestSingleInstance entity = SingleInstance.TestSingleInstance.Instance; }); } Task.WaitAll(taskArray); }
static TestSingleInstance() { Console.WriteLine("Create Instance..."); _Instance = new TestSingleInstance(); }