Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 private static async Task WaitAwaiter(bool isCompleted)
 {
     var t = new TestAwaiter(isCompleted);
     string res = await t;
     var stack = new StackTrace();
     Console.WriteLine(stack);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
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);
        }