You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Callbacks can occur after the Dispose() method overload has been called, because the timer queues callbacks for execution by thread pool threads. You can use the Dispose(WaitHandle) method overload to wait until all callbacks have completed.
If we are interpretting this correctly, what this is saying is that even though we dispose of the timer in DisableFutureChecks(), we don't guarantee that it'll never fire.
Further, the remarks for Timer.Change state:
If dueTime is Timeout.Infinite, the callback method is never invoked; the timer is disabled, but can be re-enabled by calling Change and specifying a positive value for dueTime.
If period is zero (0) or Timeout.Infinite, and dueTime is not Timeout.Infinite, the callback method is invoked once; the periodic behavior of the timer is disabled, but can be re-enabled by calling Change and specifying a positive value for period.
Which to me says that to disable the Timer, you can Change it with a dueTime of Timeout.Infinite and a period of Timeout.Infinite.
The text was updated successfully, but these errors were encountered:
Set the timer to infinite timeout so that it actually disables the
timeout.
Disable Future Checks when license is invalid. Calling this prior to
checking for expired license as the timer will still throw an exception
even when expired.
Set the timer to infinite timeout so that it actually disables the
timeout.
Disable Future Checks when license is invalid. Calling this prior to
checking for expired license as the timer will still throw an exception
even when expired.
While working to reproduce and debug chocolatey/choco#2289, @vexx32 found this handy note about
Timer.Dispose
:If we are interpretting this correctly, what this is saying is that even though we dispose of the timer in
DisableFutureChecks()
, we don't guarantee that it'll never fire.Further, the remarks for
Timer.Change
state:Which to me says that to disable the Timer, you can
Change
it with a dueTime ofTimeout.Infinite
and a period ofTimeout.Infinite
.The text was updated successfully, but these errors were encountered: