From 7a8f96dbd91796e90fbf52f354254b75d3e4ce3c Mon Sep 17 00:00:00 2001 From: mwojcik Date: Wed, 25 May 2022 10:36:38 +0800 Subject: [PATCH] rtio_mgt: use mutex's async_lock --- src/runtime/src/rtio_mgt.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/src/rtio_mgt.rs b/src/runtime/src/rtio_mgt.rs index 17f86796..a77f2e0d 100644 --- a/src/runtime/src/rtio_mgt.rs +++ b/src/runtime/src/rtio_mgt.rs @@ -52,7 +52,7 @@ pub mod drtio { if !link_rx_up(linkno).await { return Err("link went down"); } - let _lock = aux_mutex.lock(); + let _lock = aux_mutex.async_lock().await; drtioaux_async::send(linkno, request).await.unwrap(); recv_aux_timeout(linkno, 200, timer).await } @@ -91,7 +91,7 @@ pub mod drtio { } async fn sync_tsc(aux_mutex: &Rc>, linkno: u8, timer: GlobalTimer) -> Result<(), &'static str> { - let _lock = aux_mutex.lock(); + let _lock = aux_mutex.async_lock().await; unsafe { (csr::DRTIO[linkno as usize].set_time_write)(1); @@ -145,7 +145,7 @@ pub mod drtio { } async fn process_unsolicited_aux(aux_mutex: &Rc>, linkno: u8) { - let _lock = aux_mutex.lock(); + let _lock = aux_mutex.async_lock().await; match drtioaux_async::recv(linkno).await { Ok(Some(packet)) => warn!("[LINK#{}] unsolicited aux packet: {:?}", linkno, packet), Ok(None) => (),