From 61616235b87ea1a816a3cf8138cd68587fbd2cd6 Mon Sep 17 00:00:00 2001 From: yukang Date: Tue, 16 Jan 2024 10:43:57 +0800 Subject: [PATCH] clean up verify vms --- script/src/verify.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/script/src/verify.rs b/script/src/verify.rs index 7a4b4f6bae6..2d08503db22 100644 --- a/script/src/verify.rs +++ b/script/src/verify.rs @@ -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, @@ -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() => {