Skip to content

Commit

Permalink
clean up verify vms
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Jan 16, 2024
1 parent 1924783 commit 6161623
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions script/src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ fn run_vms(
}
}

// Run a series of VMs that are just freshly resumed
// Run a series of VMs with control signal, will only return when verification finished
async fn run_vms_with_signal(
script_group: &ScriptGroup,
max_cycles: Cycle,
Expand All @@ -1409,11 +1409,13 @@ async fn run_vms_with_signal(
loop {
tokio::select! {
_ = signal.changed() => {
let state = signal.borrow().to_owned();
if state == ChunkCommand::Suspend {
pause.interrupt();
} else if state == ChunkCommand::Resume {
child_sender.send(ChunkCommand::Resume).unwrap();
match signal.borrow().to_owned() {
ChunkCommand::Suspend => {
pause.interrupt();
}
ChunkCommand::Resume => {
child_sender.send(ChunkCommand::Resume).unwrap();
}
}
}
Some(res) = finished_recv.recv() => {
Expand Down

0 comments on commit 6161623

Please sign in to comment.