Uh oh!
There was an error while loading. Please reload this page.
[wasm][mt] throw from blocking wait on JS interop threads - #97052
Conversation
ghost
commented
Jan 16, 2024
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. |
Uh oh!
There was an error while loading. Please reload this page.
radekdoulik
commented
Jan 18, 2024
The current approach doesn't solve the blocking wait in JS interop, which is then throwing the exception for us too. We discussed it in chat and agreed on the introduction of a new flag to signal that the wait comes from JS interop code. The flag can be added to the Monitor class and thus simplify the thread JS interop thread detection. |
…row-from-blocking-wait
To not mix intree references and source project
This replaces the previous context base and makes it possible to disable throw for blocking calls in JS interop
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
radekdoulik
commented
Jan 19, 2024
New fail to look into: |
pavelsavara
commented
Jan 19, 2024
It's unrelated to your PR, please add it to #96628 |
|
Azure Pipelines successfully started running 1 pipeline(s). |
radekdoulik
commented
Jan 30, 2024
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
pavelsavara
commented
Jan 31, 2024
This is unrelated. |
pavelsavara
commented
Jan 31, 2024
pavelsavara
commented
Jan 31, 2024
Quick list of APIs, for which we need to validate that they internally use something we already addressed so far.
I'm sure I missed some places. |
radekdoulik
commented
Feb 1, 2024
Lets get this in and I can extend the tests and API coverage in follow up PR. |
| public static bool Wait(object obj, int millisecondsTimeout) | ||
| { | ||
| ArgumentNullException.ThrowIfNull(obj); | ||
| #if FEATURE_WASM_THREADS |
There was a problem hiding this comment.
Let's make helper method for this and localize the message.
The method should be "public" but suppressed same like ThrowOnBlockingWaitOnJSInteropThread.
So that we could use it in other places in the runtime.
| var threadFlag = Monitor.ThrowOnBlockingWaitOnJSInteropThread; | ||
| Monitor.ThrowOnBlockingWaitOnJSInteropThread = false; | ||
| signal.Wait(); | ||
| Monitor.ThrowOnBlockingWaitOnJSInteropThread = threadFlag; |
There was a problem hiding this comment.
should this be in try-finally ?
could .Wait ever throw ?
@radekdoulik
pavelsavara
commented
Feb 1, 2024
It was actually related but hiding behind another problem. I'm fixing it in #97832 |
The project files have now diferent dependencies
* Update solution files after changes in #97052 The project files have now diferent dependencies * Update System.Runtime.InteropServices.JavaScript.sln * Update System.Net.Http.sln * Update System.Net.WebSockets.Client.sln --------- Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>

Also add test
Contributes to #76958