Method Remove
Remove(object)
Cancels all timeout occurrences associated with a previously returned token.
bool Remove(object token)
Parameters
tokenobject
Returns
- bool
true if at least one queued occurrence was removed or a cancellation request was recorded for at least one active occurrence; otherwise, false.
Remarks
The token parameter is the value returned by Add(TimeSpan, Func<bool>) or Add(Timeout). All matching queued occurrences are removed.
A matching callback that is already executing is not interrupted, but it will not be rescheduled if it returns true. Occurrences registered after the cancellation takes effect are not affected, including occurrences created by adding the same Timeout instance again. A concurrent Add(TimeSpan, Func<bool>) or Add(Timeout) call can be ordered before or after the cancellation.