Fix atomic.wait, get wasi_ctx exit code and thread mgr issues (#2024)

- Remove notify_stale_threads_on_exception and change atomic.wait
  to be interruptible by keep waiting and checking every one second,
  like the implementation of poll_oneoff in libc-wasi
- Wait all other threads exit and then get wasi exit_code to avoid
  getting invalid value
- Inherit suspend_flags of parent thread while creating new thread to
  avoid terminated flag isn't set for new thread
- Fix wasi-threads test case update_shared_data_and_alloc_heap
- Add "Lib wasi-threads enabled" prompt for cmake
- Fix aot get exception, use aot_copy_exception instead
This commit is contained in:
Wenyong Huang
2023-03-15 07:47:36 +08:00
committed by GitHub
parent 2de24587a8
commit bab2402b6e
8 changed files with 95 additions and 81 deletions

View File

@ -525,6 +525,9 @@ wasm_cluster_spawn_exec_env(WASMExecEnv *exec_env)
goto fail4;
}
/* Inherit suspend_flags of parent thread */
new_exec_env->suspend_flags.flags = exec_env->suspend_flags.flags;
if (!wasm_cluster_add_exec_env(cluster, new_exec_env))
goto fail4;
@ -674,6 +677,9 @@ wasm_cluster_create_thread(WASMExecEnv *exec_env,
new_exec_env->aux_stack_bottom.bottom = UINT32_MAX;
}
/* Inherit suspend_flags of parent thread */
new_exec_env->suspend_flags.flags = exec_env->suspend_flags.flags;
if (!wasm_cluster_add_exec_env(cluster, new_exec_env))
goto fail3;