Implement Windows thread/mutex/cond APIs to support multi-thread (#627)

Implement Windows thread/mutex/cond related APIs to support Windows multi-thread feature
Change Windows HW boundary check implementation for multi-thread: change SEH to VEH
Fix wasm-c-api issue of getting AOTFunctionInstance by index, fix wasm-c-api compile warnings
Enable to build invokeNative_general.c with cmake variable
Fix several issues in lib-pthread
Disable two LLVM passes in multi-thread mode to reserve volatile semantic
Update docker script and document to build iwasm with Docker image

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2021-05-11 16:48:49 +08:00
committed by GitHub
parent 9710d9325f
commit 64b5459066
21 changed files with 1022 additions and 653 deletions

View File

@ -495,20 +495,18 @@ wasm_cluster_exit_thread(WASMExecEnv *exec_env, void *retval)
#ifdef OS_ENABLE_HW_BOUND_CHECK
if (exec_env->jmpbuf_stack_top) {
WASMJmpBuf *jmpbuf_node;
/* Store the return value in exec_env */
exec_env->thread_ret_value = retval;
exec_env->suspend_flags.flags |= 0x08;
/* Free all jmpbuf_node except the last one */
#ifndef BH_PLATFORM_WINDOWS
/* Pop all jmpbuf_node except the last one */
while (exec_env->jmpbuf_stack_top->prev) {
jmpbuf_node = wasm_exec_env_pop_jmpbuf(exec_env);
wasm_runtime_free(jmpbuf_node);
wasm_exec_env_pop_jmpbuf(exec_env);
}
jmpbuf_node = exec_env->jmpbuf_stack_top;
os_longjmp(jmpbuf_node->jmpbuf, 1);
os_longjmp(exec_env->jmpbuf_stack_top->jmpbuf, 1);
return;
#endif
}
#endif