CancellationTokenSource has a TryReset() member. The documentation appears so strict as to make me wonder why it exists.
- It will only work if no-one has already called
Cancel()on it. - It is only valid to use when any previous asynchronous operations issued with its token have completed, which means (I think) that I would need to hang on to my Task object to track whether it is still running
- It is not safe to call when someone else is trying to cancel the operation, requiring
So why would people bother with TryReset? Why not simply create a brand new CancellationTokenSource for every asynchronous operation and then throw it away after the operation completes and cancellation is no longer needed? Is CancellationTokenSource a terribly expensive object to create?