Avoid capturing ExecutionContext into CancellationTokenSource's Timer (dotnet/coreclr...
authorStephen Toub <stoub@microsoft.com>
Thu, 28 Jun 2018 14:26:21 +0000 (10:26 -0400)
committerGitHub <noreply@github.com>
Thu, 28 Jun 2018 14:26:21 +0000 (10:26 -0400)
commit294d8b4244e1ccbb738f105437969834e880d86a
treec5b1f80c94d77d225e2d6371bff74cd95e3d4b02
parent106b39eecd81d5235c8066ddcc0c2e24064dd62d
Avoid capturing ExecutionContext into CancellationTokenSource's Timer (dotnet/coreclr#18670)

* Avoid capturing ExecutionContext into CancellationTokenSource's Timer

It's not needed, and it can keep unrelated state alive unnecessarily

* Address PR feedback

Commit migrated from https://github.com/dotnet/coreclr/commit/7d72463b1107cc6f264fcbdc06e3c4df0d9ed668
src/coreclr/src/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs
src/coreclr/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs
src/coreclr/src/System.Private.CoreLib/src/System/Threading/Timer.cs