Skip to content

Commit bf0a767

Browse files
committed
more
1 parent 4fd24c9 commit bf0a767

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

accepted/2023/wasm-browser-threads.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ There are few downsides to them
203203
- could do full JSImport/JSExport to it's own JS `self` context
204204
- there is `JSSynchronizationContext`` installed on it
205205
- so that user code could dispatch back to it, in case that it needs to call `JSObject` proxy (with thread affinity)
206+
- this thread needs to throw on any `.Wait` because of the problem **7**
206207

207208
## HTTP and WS clients
208209
- are implemented in terms of `JSObject` and `Promise` proxies
@@ -280,7 +281,7 @@ There are few downsides to them
280281
- there are 2 dimensions: the thread and the method
281282
- there are 2 steps:
282283
- A) obtain existing `JSHandle` on next call (if available)
283-
- to avoid double dispatch, this needs to be accessible
284+
- to avoid double dispatch, this needs to be accessible
284285
- by any caller thread
285286
- or by UI thread C code (not managed)
286287
- B) if this is first call to the method on the target thread, create the target `JSHandle` by binding existing JS function
@@ -719,7 +720,7 @@ Related Net8 tracking https://github.com/dotnet/runtime/issues/85592
719720
- enable dynamic thread allocation
720721
- throw exceptions in dev loop when UI thread does `lock` or `.Wait` in user code
721722

722-
## Scratch pad
723+
## Scratch pad
723724

724725
current generated `JSImport` in Net7, Net8
725726

@@ -736,11 +737,11 @@ public static partial Task WebSocketReceive(JSObject webSocket, nint bufferPtr,
736737
{
737738
if (__signature_WebSocketReceive_1144640460 == null)
738739
{
739-
__signature_WebSocketReceive_1144640460 = JSFunctionBinding.BindJSFunction("INTERNAL.ws_wasm_receive", null, new JSMarshalerType[] {
740-
JSMarshalerType.Task(),
741-
JSMarshalerType.JSObject,
742-
JSMarshalerType.IntPtr,
743-
JSMarshalerType.Int32
740+
__signature_WebSocketReceive_1144640460 = JSFunctionBinding.BindJSFunction("INTERNAL.ws_wasm_receive", null, new JSMarshalerType[] {
741+
JSMarshalerType.Task(),
742+
JSMarshalerType.JSObject,
743+
JSMarshalerType.IntPtr,
744+
JSMarshalerType.Int32
744745
});
745746
}
746747

@@ -750,7 +751,7 @@ public static partial Task WebSocketReceive(JSObject webSocket, nint bufferPtr,
750751
ref JSMarshalerArgument __arg_return = ref __arguments_buffer[1];
751752
__arg_return.Initialize();
752753
Task __retVal;
753-
754+
754755
ref JSMarshalerArgument __bufferLength_native__js_arg = ref __arguments_buffer[4];
755756
ref JSMarshalerArgument __bufferPtr_native__js_arg = ref __arguments_buffer[3];
756757
ref JSMarshalerArgument __webSocket_native__js_arg = ref __arguments_buffer[2];
@@ -780,7 +781,7 @@ internal static unsafe void __Wrapper_Dummy_1616792047(JSMarshalerArgument* __ar
780781
try
781782
{
782783

783-
__meaningPromise_native__js_arg.ToManaged(out meaningPromise,
784+
__meaningPromise_native__js_arg.ToManaged(out meaningPromise,
784785
static (ref JSMarshalerArgument __task_result_arg, out int __task_result) =>
785786
{
786787
__task_result_arg.ToManaged(out __task_result);

0 commit comments

Comments
 (0)