示例#1
0
        public override async ValueTask <long> CalcSomething()
        {
            Console.WriteLine("Got to wait long time");
            var ret = await CustomAwaiter.TryTCSAwaiter();

            return(await ValueTask.FromResult(ret));
        }
示例#2
0
文件: Context.cs 项目: fjod/interview
        public static async Task <long> SwitchOnContext()
        {
            PrintThread("before calling, with configure");
            var ret = await CustomAwaiter.TryTCSAwaiter().ConfigureAwait(false);

            PrintThread("after calling, with configure");
            return(ret);
        }
示例#3
0
文件: Context.cs 项目: fjod/interview
        public static async Task <long> SameContext()
        {
            PrintThread("before calling, without configure");
            var ret = await CustomAwaiter.TryTCSAwaiter();

            PrintThread("after calling, without configure");
            return(ret);
        }
示例#4
0
 public override Task <long> CalcSomething()
 {
     Console.WriteLine("Got to wait long time");
     return(CustomAwaiter.TryTCSAwaiter());
 }