CancellationTokenSourceExtensionsCancelAfter Method |
Namespace: Rackspace.Threading
Exception | Condition |
---|---|
ArgumentNullException | If cts is . |
ObjectDisposedException | If cts has been disposed. |
ArgumentOutOfRangeException | If the TotalMilliseconds property of delay is less than -1 or greater than MaxValue. |
If a previous call to this method scheduled a cancellation, the cancellation time is reset to the new delay value. This method has no effect if the CancellationTokenSource has already been canceled (i.e. the IsCancellationRequested property returns .
In all versions of .NET, requesting cancellation of a CancellationTokenSource will not prevent the instance from becoming eligible for garbage collection prior to the timer expiring. In .NET 4 and newer, any associated Timer instance will become eligible for garbage collection at the same time as the associated CancellationTokenSource.