From 4ca97125ad7cdf4156c071ccbe88c1f819c97dca Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 14 Oct 2020 19:26:33 +0800 Subject: [PATCH] xous: hosted: retry when WouldBlock is received Retry a message when we receive a WouldBlock response. Signed-off-by: Sean Cross --- xous-rs/src/arch/hosted.rs | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/xous-rs/src/arch/hosted.rs b/xous-rs/src/arch/hosted.rs index 2788045d1..64bbab36b 100644 --- a/xous-rs/src/arch/hosted.rs +++ b/xous-rs/src/arch/hosted.rs @@ -428,19 +428,24 @@ pub fn _xous_syscall( let mut xsc_borrowed = xsc.borrow_mut(); let xsc_asmut = xsc_borrowed.as_mut().expect("not connected to server!"); - _xous_syscall_to( - nr, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - &call, - &mut xsc_asmut.send.lock().unwrap(), - ); - _xous_syscall_result(&call, ret, *tid.borrow(), xsc_asmut); + loop { + _xous_syscall_to( + nr, + a1, + a2, + a3, + a4, + a5, + a6, + a7, + &call, + &mut xsc_asmut.send.lock().unwrap(), + ); + _xous_syscall_result(&call, ret, *tid.borrow(), xsc_asmut); + if *ret != Result::WouldBlock { + return; + } + } }) }); }