Просмотр исходного кода

fix debugger: Set termination flags also when in debug mode (#2048)

When using multiple threads, termination flags are checked to stop the thread
if a `proc_exit` or trap occurs. They have to be set also in debug mode.

Tested using [WASI thread tests](https://github.com/bytecodealliance/wasm-micro-runtime/tree/main/core/iwasm/libraries/lib-wasi-threads/test).
Enrico Loparco 2 лет назад
Родитель
Сommit
bfbe51e1b3
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      core/iwasm/libraries/thread-mgr/thread_manager.c

+ 3 - 3
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);
 }