Fix thread manager issues (#962)

Fix the issue that joining a detached thread might result in joining hang,
resolve the issue by adding wait_count for a thread's exec_env to indicate
whether a thread needs to detach itself or not when it exits.

And add checks for the input exec_env for cluster's join/detach/cancel thread.
This commit is contained in:
Wenyong Huang
2022-01-17 17:09:04 +08:00
committed by GitHub
parent ee97e30a1a
commit 092efbfe21
3 changed files with 66 additions and 2 deletions

View File

@ -98,6 +98,8 @@ typedef struct WASMExecEnv {
/* used to support debugger */
korp_mutex wait_lock;
korp_cond wait_cond;
/* the count of threads which are joining current thread */
uint32 wait_count;
#endif
#if WASM_ENABLE_DEBUG_INTERP != 0