From 4071fd90f171b3c717a9d61e757c4f7031c655a8 Mon Sep 17 00:00:00 2001 From: Zhang Junyu Date: Wed, 11 Mar 2026 22:36:58 +0800 Subject: [PATCH] fix: Use tokio as pl011 thread --- crates/vm-device/src/device/pl011.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/vm-device/src/device/pl011.rs b/crates/vm-device/src/device/pl011.rs index 75c21ca..e1a0512 100644 --- a/crates/vm-device/src/device/pl011.rs +++ b/crates/vm-device/src/device/pl011.rs @@ -3,7 +3,6 @@ use std::io::Read; use std::io::Write; use std::sync::Arc; use std::sync::Mutex; -use std::thread; use bitflags::Flags; use strum_macros::FromRepr; @@ -573,9 +572,9 @@ impl Pl011 { pub fn new(mmio_range: MmioRange, irq_chip: Arc) -> Self { let pl011 = Arc::new(Mutex::new(Pl011Internal::new(irq_chip))); - thread::spawn({ + tokio::spawn({ let pl011 = pl011.clone(); - move || { + async move { let stdin = io::stdin(); let mut handle = stdin.lock(); let mut buffer = [0u8; 1];