File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -517,11 +517,18 @@ getOrCreateThreadLocalWasm(std::shared_ptr<WasmHandleBase> base_wasm,
517
517
WasmHandleCloneFactory clone_factory) {
518
518
auto wasm_handle = getThreadLocalWasm (base_wasm->wasm ()->vm_key ());
519
519
if (wasm_handle) {
520
- auto root_context = wasm_handle->wasm ()->getOrCreateRootContext (plugin);
521
- if (!wasm_handle->wasm ()->configure (root_context, plugin)) {
522
- base_wasm->wasm ()->fail (FailState::ConfigureFailed,
523
- " Failed to configure thread-local Wasm code" );
524
- return nullptr ;
520
+ auto root_context = wasm_handle->wasm ()->getRootContext (plugin->key ());
521
+ if (!root_context) {
522
+ root_context = wasm_handle->wasm ()->start (plugin);
523
+ if (!root_context) {
524
+ base_wasm->wasm ()->fail (FailState::StartFailed, " Failed to start thread-local Wasm" );
525
+ return nullptr ;
526
+ }
527
+ if (!wasm_handle->wasm ()->configure (root_context, plugin)) {
528
+ base_wasm->wasm ()->fail (FailState::ConfigureFailed,
529
+ " Failed to configure thread-local Wasm plugin" );
530
+ return nullptr ;
531
+ }
525
532
}
526
533
return wasm_handle;
527
534
}
You can’t perform that action at this time.
0 commit comments