Separate CancellationTokenSource linking into a derived class
authorstephentoub <stoub@microsoft.com>
Fri, 20 Nov 2015 17:36:24 +0000 (12:36 -0500)
committerstephentoub <stoub@microsoft.com>
Fri, 20 Nov 2015 20:43:20 +0000 (15:43 -0500)
commit35b402522836ffe14983cc1e779c22ad137ac968
treeac869721b112afa41a41891753565306a424cfcf
parent5ec78c8fd54c1a60ab9ed1b3478e9d1df4a17f8c
Separate CancellationTokenSource linking into a derived class

The m_linkingRegistrations field is only used on CancellationTokenSource instances created by CreateLinkedTokenSource.  This commit creates a private LinkedCancellationTokenSource to contain that field and related logic, so that the field is pay for play.  This shaves off ~11% of normal CancellationTokenSource's memory consumption.
src/mscorlib/src/System/Threading/CancellationTokenSource.cs