From 1b5868bfd57445d19186d30bc85838c2b57ec8d6 Mon Sep 17 00:00:00 2001 From: Leo-Besancon Date: Thu, 19 Dec 2024 14:17:14 +0100 Subject: [PATCH] Avoid taking a lock --- massa-execution-worker/src/execution.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/massa-execution-worker/src/execution.rs b/massa-execution-worker/src/execution.rs index f6733dbf09..cb72d28e85 100644 --- a/massa-execution-worker/src/execution.rs +++ b/massa-execution-worker/src/execution.rs @@ -189,16 +189,16 @@ impl ExecutionState { }))); // Create an empty placeholder execution context, with shared atomic access - let execution_context = Arc::new(Mutex::new(ExecutionContext::new( + let unwrapped_execution_context = ExecutionContext::new( config.clone(), final_state.clone(), active_history.clone(), module_cache.clone(), mip_store.clone(), execution_trail_hash, - ))); - - let cur_execution_version = execution_context.lock().execution_component_version; + ); + let cur_execution_version = unwrapped_execution_context.execution_component_version; + let execution_context = Arc::new(Mutex::new(unwrapped_execution_context)); // Instantiate the interface providing ABI access to the VM, share the execution context with it let execution_interface = Box::new(InterfaceImpl::new(