Skip to content

Commit e56337b

Browse files
committed
fix(wasi-threads): return exit code set by proc_exit
1 parent e516de8 commit e56337b

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

core/iwasm/interpreter/wasm_interp_classic.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3716,7 +3716,9 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
37163716
value: readv * 0 + sval */
37173717
DEF_ATOMIC_RMW_OPCODE(XCHG, *0 +);
37183718
}
3719-
3719+
#if WASM_ENABLE_THREAD_MGR != 0
3720+
CHECK_SUSPEND_FLAGS();
3721+
#endif
37203722
HANDLE_OP_END();
37213723
}
37223724
#endif
@@ -3898,6 +3900,9 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
38983900
CHECK_SUSPEND_FLAGS();
38993901
#endif
39003902
}
3903+
#if WASM_ENABLE_THREAD_MGR != 0
3904+
CHECK_SUSPEND_FLAGS();
3905+
#endif
39013906
HANDLE_OP_END();
39023907
}
39033908

core/iwasm/libraries/thread-mgr/thread_manager.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ wasm_cluster_create(WASMExecEnv *exec_env)
225225
/* Prepare the aux stack top and size for every thread */
226226
if (!wasm_exec_env_get_aux_stack(exec_env, &aux_stack_start,
227227
&aux_stack_size)) {
228+
#if WASM_ENABLE_LIB_WASI_THREADS == 0
228229
LOG_VERBOSE("No aux stack info for this module, can't create thread");
230+
#endif
229231

230232
/* If the module don't have aux stack info, don't throw error here,
231233
but remain stack_tops and stack_segment_occupied as NULL */

0 commit comments

Comments
 (0)