Use pre-created exec_env for instantiation and module_malloc/free (#2047)
Use pre-created exec_env for instantiation and module_malloc/free, use the same exec_env of the current thread to avoid potential unexpected behavior. And remove unnecessary shared_mem_lock in wasm_module_free, which may cause dead lock.
This commit is contained in:
@ -90,7 +90,7 @@ thread_spawn_wrapper(wasm_exec_env_t exec_env, uint32 start_arg)
|
||||
stack_size = ((WASMModuleInstance *)module_inst)->default_wasm_stack_size;
|
||||
|
||||
if (!(new_module_inst = wasm_runtime_instantiate_internal(
|
||||
module, true, stack_size, 0, NULL, 0)))
|
||||
module, true, exec_env, stack_size, 0, NULL, 0)))
|
||||
return -1;
|
||||
|
||||
wasm_runtime_set_custom_data_internal(
|
||||
|
||||
Reference in New Issue
Block a user