示例#1
0
        private static void FunWithOneTimeGate()
        {
            OneTimeGate mre = new OneTimeGate();

            mre.WaitAsync().ContinueWith(t => CW("Wait 1 complete"));
            mre.WaitAsync().ContinueWith(t => CW("Wait 2 complete"));
            mre.WaitAsync().ContinueWith(t => CW("Wait 3 complete"));

            Console.WriteLine("Press Enter to Continue");
            Console.ReadLine();

            mre.Set();

            mre.WaitAsync().ContinueWith(t => CW("Wait 4 complete"));
            mre.WaitAsync().ContinueWith(t => CW("Wait 5 complete"));
            mre.WaitAsync().ContinueWith(t => CW("Wait 6 complete"));


            Console.WriteLine("Press Enter to Continue");
            Console.ReadLine();
        }
示例#2
0
文件: Program.cs 项目: adbk/spikes
        private static void FunWithOneTimeGate()
        {
            OneTimeGate mre = new OneTimeGate();
            mre.WaitAsync().ContinueWith(t => CW("Wait 1 complete"));
            mre.WaitAsync().ContinueWith(t => CW("Wait 2 complete"));
            mre.WaitAsync().ContinueWith(t => CW("Wait 3 complete"));

            Console.WriteLine("Press Enter to Continue");
            Console.ReadLine();

            mre.Set();

            mre.WaitAsync().ContinueWith(t => CW("Wait 4 complete"));
            mre.WaitAsync().ContinueWith(t => CW("Wait 5 complete"));
            mre.WaitAsync().ContinueWith(t => CW("Wait 6 complete"));


            Console.WriteLine("Press Enter to Continue");
            Console.ReadLine();

        }