Use ValueTask shared from corelib (dotnet/corefx#26636)
authorStephen Toub <stoub@microsoft.com>
Thu, 1 Feb 2018 22:22:00 +0000 (17:22 -0500)
committerJan Kotas <jkotas@microsoft.com>
Thu, 1 Feb 2018 23:50:34 +0000 (15:50 -0800)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
src/mscorlib/shared/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilder.cs

index 23da48e..ac9886a 100644 (file)
@@ -40,7 +40,12 @@ namespace System.Runtime.CompilerServices
         /// <param name="stateMachine">The state machine instance, passed by reference.</param>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine =>
+            // will provide the right ExecutionContext semantics
+#if netstandard
+            _methodBuilder.Start(ref stateMachine);
+#else
             AsyncMethodBuilder.Start(ref stateMachine); // will provide the right ExecutionContext semantics
+#endif
 
         /// <summary>Associates the builder with the specified state machine.</summary>
         /// <param name="stateMachine">The state machine instance to associate with the builder.</param>