Skip to content

Commit 45a788b

Browse files
committed
readme
1 parent 630d16d commit 45a788b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/emnapi/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,9 @@ Now emnapi has 3 implementations of async work and 2 implementations of TSFN:
816816
There are some limitations on browser about wasi-libc's pthread implementation, for example
817817
`pthread_mutex_lock` may call `__builtin_wasm_memory_atomic_wait32`(`memory.atomic.wait32`)
818818
which is disallowed in browser JS main thread. While Emscripten's pthread implementation
819-
has considered usage in browser. If you need to run your addon with multithreaded features on browser,
820-
we recommend you use Emscripten A & D, or bare wasm32 C & E.
819+
has considered usage in browser. This issue can be solved by upgrading `wasi-sdk` to v26+
820+
and emnapi v1.5.0+ then pass `--export=emnapi_thread_crashed` to the linker. If you need to
821+
run your addon with multithreaded features, we recommend you use A & D or C & E.
821822
822823
Note: For browsers, all the multithreaded features relying on Web Workers (Emscripten pthread also relying on Web Workers)
823824
require cross-origin isolation to enable `SharedArrayBuffer`. You can make a page cross-origin isolated
@@ -879,6 +880,7 @@ elseif(CMAKE_C_COMPILER_TARGET STREQUAL "wasm32-wasi-threads")
879880
"-Wl,--export-if-defined=node_api_module_get_api_version_v1"
880881
"-Wl,--export=malloc"
881882
"-Wl,--export=free"
883+
"-Wl,--export=emnapi_thread_crashed"
882884
"-Wl,--import-undefined"
883885
"-Wl,--export-table"
884886
)

0 commit comments

Comments
 (0)