Skip to content

Commit

Permalink
Improve TimerAwaitable for allow Stop to be called mutliple times
Browse files Browse the repository at this point in the history
  • Loading branch information
vicancy committed Oct 24, 2023
1 parent 9670ea1 commit ce98f4c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public void Stop()
// Stop should be used to trigger the call to end the loop which disposes
if (_disposed)
{
throw new ObjectDisposedException(GetType().FullName);
// no need to throw, to allow Stop to be called multiple times safely
return;
}

_running = false;
Expand Down

0 comments on commit ce98f4c

Please sign in to comment.