Example #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();
        }
Example #2
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();

        }