Created
February 17, 2020 10:51
-
-
Save mgravell/8e08a7d3dbf3bbfc17ff46c494a59150 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class P | |
{ | |
static Task Main() | |
{ | |
var task = new P().DoNothing(); | |
Console.WriteLine(task.IsCompleted ? "sync" : "async"); | |
return task; | |
} | |
async Task DoNothing() | |
{ | |
const bool configureAwait = false; | |
await Wait0().ConfigureAwait(configureAwait); | |
await Wait0().ConfigureAwait(configureAwait); | |
} | |
async Task<int> Wait0() { await Task.Delay(500); return 0; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment