-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[wasm][mt] Improve blocking wait detection and tests #98045
[wasm][mt] Improve blocking wait detection and tests #98045
Conversation
Add check to the `SemaphoreSlim.Wait`. The wait will eventually continue to the `Monitor.Wait`, it can spin wait first though and return, so catch it earlier to avoid non-deterministic behavior. Improve the blocking wait detection and extract it to the new method. Also introduce helper method to force a blocking wait in places we want it on the JS interop threads.
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/ref/System.Private.CoreLib.ExtraApis.cs
Outdated
Show resolved
Hide resolved
...rvices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs
Outdated
Show resolved
Hide resolved
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Cool, I like it!
Add check to the
SemaphoreSlim.Wait
. The wait will eventually continue to theMonitor.Wait
, it can spin wait first though and return, so catch it earlier to avoid non-deterministic behavior.Improve the blocking wait detection and extract it to the new method. Also introduce a helper method to force a blocking wait in places we want it happen on the JS interop threads too.