コード例 #1
0
        //other variables

        public void MoveNext()
        {
            // Jump table to get back to the right statement upon resumption
            switch (this._state)
            {
            case 1:
                goto Label1;
            }

            var t = new TestAwaiter(true);

            this._awaiter = t.GetAwaiter();

            if (!this._awaiter.IsCompleted)
            {
                this._state = 1;
                this._awaiter.OnCompleted(MoveNext);
                return;
            }
Label1:
            string result = this._awaiter.GetResult();
            var stack = new StackTrace();

            Console.WriteLine(stack);
        }
コード例 #2
0
ファイル: Awaiter.cs プロジェクト: tazik047/threads
 private static async Task WaitAwaiter(bool isCompleted)
 {
     var t = new TestAwaiter(isCompleted);
     string res = await t;
     var stack = new StackTrace();
     Console.WriteLine(stack);
 }
コード例 #3
0
        private static async Task WaitAwaiter(bool isCompleted)
        {
            var    t     = new TestAwaiter(isCompleted);
            string res   = await t;
            var    stack = new StackTrace();

            Console.WriteLine(stack);
        }
コード例 #4
0
ファイル: Awaiter.cs プロジェクト: tazik047/threads
        //other variables

        public void MoveNext()
        {
            // Jump table to get back to the right statement upon resumption 
            switch (this._state)
            {
                case 1:
                    goto Label1;
            }

            var t = new TestAwaiter(true);
            this._awaiter = t.GetAwaiter();

            if (!this._awaiter.IsCompleted)
            {
                this._state = 1;
                this._awaiter.OnCompleted(MoveNext);
                return;

            }
            Label1:
            string result = this._awaiter.GetResult();
            var stack = new StackTrace();
            Console.WriteLine(stack);
        }