From 394138f00faa508e2d5bc9a5b7a30a54c7848018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=AB=E7=84=9A=20=E5=AF=8C=E8=89=AF?= Date: Thu, 19 Jan 2023 16:46:53 +0800 Subject: [PATCH] firmware: block session on startup kernel to be finished (#2046) --- artiq/firmware/runtime/session.rs | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/artiq/firmware/runtime/session.rs b/artiq/firmware/runtime/session.rs index c0f009a96..df3865f6b 100644 --- a/artiq/firmware/runtime/session.rs +++ b/artiq/firmware/runtime/session.rs @@ -607,25 +607,18 @@ pub fn thread(io: Io, aux_mutex: &Mutex, let mut kernel_thread = None; { - let aux_mutex = aux_mutex.clone(); - let routing_table = routing_table.clone(); - let up_destinations = up_destinations.clone(); - let congress = congress.clone(); - respawn(&io, &mut kernel_thread, move |io| { - let routing_table = routing_table.borrow(); - let mut congress = congress.borrow_mut(); - info!("running startup kernel"); - match flash_kernel_worker(&io, &aux_mutex, &routing_table, &up_destinations, &mut congress, "startup_kernel") { - Ok(()) => - info!("startup kernel finished"), - Err(Error::KernelNotFound) => - info!("no startup kernel found"), - Err(err) => { - congress.finished_cleanly.set(false); - error!("startup kernel aborted: {}", err); - } + let mut congress = congress.borrow_mut(); + info!("running startup kernel"); + match flash_kernel_worker(&io, &aux_mutex, &routing_table.borrow(), &up_destinations, &mut congress, "startup_kernel") { + Ok(()) => + info!("startup kernel finished"), + Err(Error::KernelNotFound) => + info!("no startup kernel found"), + Err(err) => { + congress.finished_cleanly.set(false); + error!("startup kernel aborted: {}", err); } - }) + } } loop {