Fix execute_main not wait for other threads (#1137)

Fix wasm_application_execute_main/wasm_application_execute_func not waiting for
other threads to terminate in multi-thread mode, which causes that the exception
thrown by other threads may haven't been spreaded to current main thread, and
cannot be detected by the caller, as reported in #1131.
This commit is contained in:
Wenyong Huang
2022-04-29 15:47:43 +08:00
committed by GitHub
parent 2e27d506d8
commit c6997aa68a
4 changed files with 92 additions and 10 deletions

View File

@ -100,6 +100,9 @@ typedef struct WASMExecEnv {
korp_cond wait_cond;
/* the count of threads which are joining current thread */
uint32 wait_count;
/* whether current thread is detached */
bool thread_is_detached;
#endif
#if WASM_ENABLE_DEBUG_INTERP != 0