Skip to content

Commit dfe1dd9

Browse files
committed
Add comment about order of set_running vs is_cancelled
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent 7bf68a9 commit dfe1dd9

File tree

1 file changed

+2
-0
lines changed
  • src/hyperlight_host/src/hypervisor

1 file changed

+2
-0
lines changed

src/hyperlight_host/src/hypervisor/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ impl VirtualCPU {
374374
#[cfg(any(kvm, mshv3))]
375375
interrupt_handle.set_tid();
376376
interrupt_handle.set_running();
377+
// NOTE: `set_running()`` must be called before checking `is_cancelled()`
378+
// otherwise we risk missing a call to `kill()` because the vcpu would not be marked as running yet so signals won't be sent
377379

378380
let exit_reason = {
379381
if interrupt_handle.is_cancelled() || interrupt_handle.is_debug_interrupted() {

0 commit comments

Comments
 (0)