Grab cluster->lock when modifying exec_env->module_inst (#2685)
Fixes: https://github.com/bytecodealliance/wasm-micro-runtime/issues/2680 And when switching back to the original module_inst, propagate exception if any. cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/2512
This commit is contained in:
@ -1406,3 +1406,19 @@ exception_unlock(WASMModuleInstance *module_inst)
|
||||
{
|
||||
os_mutex_unlock(&_exception_lock);
|
||||
}
|
||||
|
||||
void
|
||||
wasm_cluster_traverse_lock(WASMExecEnv *exec_env)
|
||||
{
|
||||
WASMCluster *cluster = wasm_exec_env_get_cluster(exec_env);
|
||||
bh_assert(cluster);
|
||||
os_mutex_lock(&cluster->lock);
|
||||
}
|
||||
|
||||
void
|
||||
wasm_cluster_traverse_unlock(WASMExecEnv *exec_env)
|
||||
{
|
||||
WASMCluster *cluster = wasm_exec_env_get_cluster(exec_env);
|
||||
bh_assert(cluster);
|
||||
os_mutex_unlock(&cluster->lock);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user