@@ -1079,12 +1079,14 @@ wasm_interp_call_func_import(WASMModuleInstance *module_inst,
10791079 /* Record the current frame_ip, so when exception occurs, \
10801080 debugger can know the exact opcode who caused the exception */ \
10811081 frame_ip_orig = frame_ip ; \
1082+ os_mutex_lock (& exec_env -> wait_lock ); \
10821083 while (exec_env -> current_status -> signal_flag == WAMR_SIG_SINGSTEP \
10831084 && exec_env -> current_status -> step_count ++ == 1 ) { \
10841085 exec_env -> current_status -> step_count = 0 ; \
10851086 SYNC_ALL_TO_FRAME ( ); \
10861087 wasm_cluster_thread_waiting_run (exec_env ); \
10871088 } \
1089+ os_mutex_unlock (& exec_env -> wait_lock ); \
10881090 goto * handle_table [* frame_ip ++ ]; \
10891091 } while (0 )
10901092#else
@@ -1095,12 +1097,14 @@ wasm_interp_call_func_import(WASMModuleInstance *module_inst,
10951097#define HANDLE_OP (opcode ) case opcode:
10961098#if WASM_ENABLE_THREAD_MGR != 0 && WASM_ENABLE_DEBUG_INTERP != 0
10971099#define HANDLE_OP_END () \
1100+ os_mutex_lock(&exec_env->wait_lock); \
10981101 if (exec_env->current_status->signal_flag == WAMR_SIG_SINGSTEP \
10991102 && exec_env->current_status->step_count++ == 2) { \
11001103 exec_env->current_status->step_count = 0; \
11011104 SYNC_ALL_TO_FRAME(); \
11021105 wasm_cluster_thread_waiting_run(exec_env); \
11031106 } \
1107+ os_mutex_unlock(&exec_env->wait_lock); \
11041108 continue
11051109#else
11061110#define HANDLE_OP_END () continue
0 commit comments