dotnet / dotnet/dotnet-api-docs

System.Threading.Timer.Change docs incorrect

Open
#10,182 2 comments 0 reactions 0 assignees View on GitHub
area-System.Threading Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

### Describe the issue or suggestion

The [docs ](https://learn.microsoft.com/en-us/dotnet/api/system.threading.timer.change?view=net-8.0#system-threading-timer-change(system-int32-system-int32)) for each of the overloads of Timer.Change say the following:

> Exceptions
[ObjectDisposedException](https://learn.microsoft.com/en-us/dotnet/api/system.objectdisposedexception?view=net-8.0)
The [Timer](https://learn.microsoft.com/en-us/dotnet/api/system.threading.timer?view=net-8.0) has already been disposed.

But it looks like this was intentionally changed in .NET 8 to return false when the timer has been disposed instead of throwing an exception. I think the docs should be updated here, and maybe even a note on the behavioral change if that also seems appropriate.

https://github.com/dotnet/runtime/pull/83604/files#diff-103eceae144a767ba8f1e3b8760cee55cda37ff2af1cc5d40256fe199093c64eR47

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.