Fix terminating stale threads on trap/proc_exit (#1929)

This is to terminate suspended threads in case an atomic wait occurs with
a huge or indefinite (-1) timeout, followed by a proc exit or trap.
This commit is contained in:
Hritik Gupta
2023-02-07 12:56:23 +00:00
committed by GitHub
parent 8ed6687696
commit f3c1ad4864
3 changed files with 65 additions and 0 deletions

View File

@ -2317,6 +2317,12 @@ wasm_set_exception(WASMModuleInstance *module_inst, const char *exception)
if (exec_env) {
wasm_cluster_spread_exception(exec_env, exception ? false : true);
}
#if WASM_ENABLE_SHARED_MEMORY
if (exception) {
notify_stale_threads_on_exception(
(WASMModuleInstanceCommon *)module_inst);
}
#endif
#else
(void)exec_env;
#endif