public override async ValueTask <long> CalcSomething() { Console.WriteLine("Got to wait long time"); var ret = await CustomAwaiter.TryTCSAwaiter(); return(await ValueTask.FromResult(ret)); }
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); }
public static async Task <long> SameContext() { PrintThread("before calling, without configure"); var ret = await CustomAwaiter.TryTCSAwaiter(); PrintThread("after calling, without configure"); return(ret); }
public override Task <long> CalcSomething() { Console.WriteLine("Got to wait long time"); return(CustomAwaiter.TryTCSAwaiter()); }