Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect example #10843

Open
dmitrypyzh opened this issue Jan 16, 2025 · 0 comments
Open

Incorrect example #10843

dmitrypyzh opened this issue Jan 16, 2025 · 0 comments
Labels
area-System.Threading untriaged New issue has not been triaged by the area owner

Comments

@dmitrypyzh
Copy link

Type of issue

Code doesn't work

Description

++invokeCount in example must called under lock or interlocked because:
"The callback method executed by the timer should be reentrant, because it is called on ThreadPool threads. The callback can be executed simultaneously on two thread pool threads if the timer interval is less than the time required to execute the callback, or if all thread pool threads are in use and the callback is queued multiple times."

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.threading.timer?view=net-9.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Threading/Timer.xml

Document Version Independent Id

987f743c-c849-522e-b662-e520c1efaed1

Article author

@dotnet-bot

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Threading untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant