Change Task.Delay to use TimerQueueTimer instead of Timer
authorStephen Toub <stoub@microsoft.com>
Mon, 16 Oct 2017 19:16:31 +0000 (15:16 -0400)
committerStephen Toub <stoub@microsoft.com>
Mon, 16 Oct 2017 19:16:31 +0000 (15:16 -0400)
commit6f4dec5e4ec0297f68f1f5821d9fbfdb858ddcd4
tree8f68b2cd4cf83dff9cc706111d85e2682e78132f
parent6279aee1a2249e301b33e7d0fbaded42e041f100
Change Task.Delay to use TimerQueueTimer instead of Timer

Timer is just a wrapper for a TimerHolder which is just a wrapper for a TimerQueueTimer.  We don't actually want the behavior provided by TimerHolder (to allow the underlying timer to be collected while it's in use) and explicitly work around that, and for that pleasure we're paying two additional allocations.  Just skip directly to the inner type.
src/mscorlib/src/System/Threading/Tasks/Task.cs
src/mscorlib/src/System/Threading/Timer.cs