Reduce Execution Context Save+Restore (#15629)
authorBen Adams <thundercat@illyriad.co.uk>
Wed, 31 Jan 2018 15:24:29 +0000 (15:24 +0000)
committerStephen Toub <stoub@microsoft.com>
Wed, 31 Jan 2018 15:24:29 +0000 (10:24 -0500)
commit181680249af92aa45c8fb44a3ee865c7b61fd765
treee5d8749fd9168fc6e442bf05f7c3b8ed69a1f0e4
parentcef959a2ed41bb1077b69608b78e752326b34b47
Reduce Execution Context Save+Restore (#15629)

* Reduce Save+Restore for ExecutionContext

* Use flag rather than comparison to static

* Skip null check for pre-checked EC.Run

* Feedback

* Add static helper lookup for default context for TP

* Add note for enregistering

* Return to Default context when no values

* Default + FlowSuppressed Context

* Move AsyncMethodBuilder.Start to static non-generic

* Feedback
14 files changed:
src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
src/mscorlib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs [new file with mode: 0644]
src/mscorlib/shared/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilder.cs
src/mscorlib/shared/System/Threading/AsyncLocal.cs
src/mscorlib/shared/System/Threading/ExecutionContext.cs
src/mscorlib/src/System/IO/Stream.cs
src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs
src/mscorlib/src/System/Threading/CancellationTokenSource.cs
src/mscorlib/src/System/Threading/Overlapped.cs
src/mscorlib/src/System/Threading/Tasks/Task.cs
src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs
src/mscorlib/src/System/Threading/Thread.cs
src/mscorlib/src/System/Threading/ThreadPool.cs
src/mscorlib/src/System/Threading/Timer.cs