-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Throw NotSupportedException for WaitHandle.WaitAny with 64 handle on STA threads #1647
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
Conversation
…STA threads Fixes #1646
This is technically a breaking change, but I believe it is better to throw than silently do the wrong thing. It is unlikely that a working program depends on the current broken behavior. If we agree that that this is a good change to make, I am also going to send PR to update the docs. |
src/libraries/System.Runtime/tests/System/Threading/WaitHandleTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised by the lack of exception. I think this is worth changing.
…Tests.cs Co-Authored-By: Stephen Toub <[email protected]>
Why breaking ? |
On an STA thread, passing in 64 handles to WaitAny currently results in it immediately returning a timeout error code. This change makes it throw. |
Is it documented somewhere? |
It is not that's part of the problem. I am updating the documentation in dotnet/dotnet-api-docs#3767 |
new ManualResetEvent(true), | ||
new ManualResetEvent(true) | ||
}; | ||
ManualResetEvent[] handles = CreateManualResetEvents(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess disposing these isn’t important
Fixes #1646