Add YieldAwaiter support to the async method builder delegate optimization (#17441)
authorStephen Toub <stoub@microsoft.com>
Fri, 6 Apr 2018 13:48:35 +0000 (06:48 -0700)
committerGitHub <noreply@github.com>
Fri, 6 Apr 2018 13:48:35 +0000 (06:48 -0700)
commit721343dc84247d54ee5f3365b97b06090dfa8ade
tree01b7554f282673f56f2622929a6a47a049d9cbc7
parent69b8b732e5268bedc75cee99ecc958c903723cdf
Add YieldAwaiter support to the async method builder delegate optimization (#17441)

We added an optimization to async methods that lets the builder avoid allocating the Action delegate when it recognizes the awaiter being used.  Previously this was enabled for all of the publicly exposed awaiters in corelib, with the exception of YieldAwaiter (what's used with Task.YIeld).  It was enabled by having the awaiter implement an internal interface.  This commit just generalizes that interface name and then implements it on YIeldAwaiter to complete the picture.
src/mscorlib/shared/System/Runtime/CompilerServices/ConfiguredValueTaskAwaitable.cs
src/mscorlib/shared/System/Runtime/CompilerServices/ValueTaskAwaiter.cs
src/mscorlib/shared/System/Runtime/CompilerServices/YieldAwaitable.cs
src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs