Queue ValueTaskAwaiter IAsyncStateMachineBox directly to ThreadPool (dotnet/coreclr...
authorBen Adams <thundercat@illyriad.co.uk>
Wed, 28 Nov 2018 21:45:16 +0000 (21:45 +0000)
committerStephen Toub <stoub@microsoft.com>
Wed, 28 Nov 2018 21:45:16 +0000 (16:45 -0500)
commit5b52a99bc85fdb67a5e900bb4b6bf8f2b918529f
tree214fbca92c55c75c3083583207acefe8a25cac8d
parent3b63fd125b154956c292be35d0893cc93542a2f0
Queue ValueTaskAwaiter IAsyncStateMachineBox directly to ThreadPool (dotnet/coreclr#21159)

* Queue ValueTaskAwaiter IAsyncStateMachineBox directly to ThreadPool

* Invert the dependency

* Move to UnsafeQueueUserWorkItem

* MRVTSC queue null or Deafult EC to UnsafeQUWI

* Revert MRVTSC change

* Add comment and validation

* Use s_invokeAsyncStateMachineBox for AsTask

* nits

* nits 2

* Rever ValueTask

* nits

Commit migrated from https://github.com/dotnet/coreclr/commit/e7ead79fedc52e17f2cf9befd5c0f5091d70f909
src/coreclr/src/System.Private.CoreLib/src/System/Threading/ThreadPool.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ConfiguredValueTaskAwaitable.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ValueTaskAwaiter.cs