Skip to content

Commit 747aa10

Browse files
authored
Fix bug where main thread interpreted hypervisor-handler thread as having finished execution, but in reality it never started (#385)
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent e8b9071 commit 747aa10

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/hyperlight_host/src/hypervisor/hypervisor_handler.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ impl HypervisorHandler {
323323
// call.
324324
execution_variables.set_thread_id(unsafe { pthread_self() })?;
325325
}
326-
execution_variables.running.store(true, Ordering::SeqCst);
327326

328327
#[cfg(target_os = "linux")]
329328
execution_variables.run_cancelled.store(false);
@@ -392,9 +391,6 @@ impl HypervisorHandler {
392391
HypervisorHandlerAction::DispatchCallFromHost(function_name) => {
393392
let hv = hv.as_mut().ok_or_else(|| new_error!("Hypervisor not initialized"))?;
394393

395-
// Lock to indicate an action is being performed in the hypervisor
396-
execution_variables.running.store(true, Ordering::SeqCst);
397-
398394
#[cfg(target_os = "linux")]
399395
execution_variables.run_cancelled.store(false);
400396

@@ -599,6 +595,7 @@ impl HypervisorHandler {
599595
// `TerminateHandlerThread`.
600596
}
601597

598+
self.set_running(true);
602599
self.communication_channels
603600
.to_handler_tx
604601
.send(hypervisor_handler_action)

0 commit comments

Comments
 (0)