Use shared memory lock for threads generated from same module (#1960)

Multiple threads generated from the same module should use the same
lock to protect the atomic operations.

Before this PR, each thread used a different lock to protect atomic
operations (e.g. atomic add), making the lock ineffective.

Fix #1958.
This commit is contained in:
Enrico Loparco
2023-02-16 04:54:19 +01:00
committed by GitHub
parent 1c17665f68
commit 216dc43ab4
11 changed files with 203 additions and 146 deletions

View File

@ -41,3 +41,6 @@ target_link_libraries(test.wasm)
add_executable(main_thread_exception.wasm main_thread_exception.c)
target_link_libraries(main_thread_exception.wasm)
add_executable(main_global_atomic.wasm main_global_atomic.c)
target_link_libraries(main_global_atomic.wasm)