Skip to content

Commit be21b85

Browse files
committed
fix windows timeout tests
Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent 3299c1f commit be21b85

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/hyperlight_host/src/hypervisor/hypervisor_handler.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ impl HypervisorHandler {
233233
sandbox_memory_manager: SandboxMemoryManager<GuestSharedMemory>,
234234
) -> Result<()> {
235235
let configuration = self.configuration.clone();
236-
let sandbox_memory_manager = Arc::new(Mutex::new(sandbox_memory_manager));
237236
#[cfg(target_os = "windows")]
238-
let in_process = sandbox_memory_manager.lock().unwrap().is_in_process();
237+
let in_process = sandbox_memory_manager.is_in_process();
238+
let sandbox_memory_manager = Arc::new(Mutex::new(sandbox_memory_manager));
239239

240240
*self.execution_variables.shm.try_lock().unwrap() = Some(sandbox_memory_manager);
241241

@@ -850,10 +850,12 @@ fn set_up_hypervisor_partition(
850850

851851
#[cfg(target_os = "windows")]
852852
Some(HypervisorType::Whp) => {
853+
let mgr_lock = mgr.lock().unwrap();
854+
853855
let hv = crate::hypervisor::hyperv_windows::HypervWindowsDriver::new(
854856
regions,
855-
mgr.lock().unwrap().shared_mem.raw_mem_size(), // we use raw_* here because windows driver requires 64K aligned addresses,
856-
mgr.lock().unwrap().shared_mem.raw_ptr() as *mut c_void, // and instead convert it to base_addr where needed in the driver itself
857+
mgr_lock.shared_mem.raw_mem_size(), // we use raw_* here because windows driver requires 64K aligned addresses,
858+
mgr_lock.shared_mem.raw_ptr() as *mut c_void, // and instead convert it to base_addr where needed in the driver itself
857859
pml4_ptr.absolute()?,
858860
entrypoint_ptr.absolute()?,
859861
rsp_ptr.absolute()?,

0 commit comments

Comments
 (0)