Skip to content

Commit 58801f9

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

3 files changed

Lines changed: 14 additions & 2 deletions

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/interpreter/wasm_interp_fast.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3552,7 +3552,9 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
35523552
value: readv * 0 + sval */
35533553
DEF_ATOMIC_RMW_OPCODE(XCHG, *0 +);
35543554
}
3555-
3555+
#if WASM_ENABLE_THREAD_MGR != 0
3556+
CHECK_SUSPEND_FLAGS();
3557+
#endif
35563558
HANDLE_OP_END();
35573559
}
35583560
#endif
@@ -3826,6 +3828,9 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
38263828

38273829
wasm_exec_env_set_cur_frame(exec_env, (WASMRuntimeFrame *)frame);
38283830
}
3831+
#if WASM_ENABLE_THREAD_MGR != 0
3832+
CHECK_SUSPEND_FLAGS();
3833+
#endif
38293834
HANDLE_OP_END();
38303835
}
38313836

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)