|
private volatile bool _canceled; |
|
private volatile object? _notifyWhenNoCallbacksRunning; // may be either WaitHandle or Task<bool> |
The field _canceled is only ever referenced inside of a lock, and _notifyWhenNoCallbacksRunning is only read outside of a lock after any concurrency should be possible. So unless there is some logic in another partial class TimerQueueTimer that makes it necessary, I don't see why volatile on these fields is needed.