diff --git a/core/iwasm/libraries/thread-mgr/thread_manager.c b/core/iwasm/libraries/thread-mgr/thread_manager.c index 5e2acdbcd..2bcdba3bd 100644 --- a/core/iwasm/libraries/thread-mgr/thread_manager.c +++ b/core/iwasm/libraries/thread-mgr/thread_manager.c @@ -988,12 +988,12 @@ static void set_thread_cancel_flags(WASMExecEnv *exec_env) { os_mutex_lock(&exec_env->wait_lock); - /* Set the termination flag */ + #if WASM_ENABLE_DEBUG_INTERP != 0 wasm_cluster_thread_send_signal(exec_env, WAMR_SIG_TERM); -#else - exec_env->suspend_flags.flags |= 0x01; #endif + exec_env->suspend_flags.flags |= 0x01; + os_mutex_unlock(&exec_env->wait_lock); }