Force secondary await continuations to run asynchronously (dotnet/coreclr#25280)
* Force secondary await continuations to run asynchronously
For performance reasons, await continuations have been invoked synchronously, meaning they're invoked as part of the antecedent task's completion (as long as that task allows it, as long as there's sufficient stack space, etc.) This generally works out well in the case where there's a single await continuation, which is far and away the common case. However, it can cause problems in situations where there are multiple await continuations, as those continuations will end up being serialized, which can lead to slowdowns and deadlocks in niche situations. To address that, this commit backs off a bit. The first await continuation is still invoked synchronously, but subsequent await continuations are invoked asynchronously, such that they are not blocked by a previously registered await continuation.
* Fix nits
Commit migrated from https://github.com/dotnet/coreclr/commit/
d58a283f2a69da1509b8d76dfec0959b93e061c8