fix deadlock when quickly reading stuff

async calling sync calling async is a fucking pain
This commit is contained in:
OMGeeky
2024-04-15 18:32:39 +02:00
parent ed6af697b4
commit 4c77bd1ba1
2 changed files with 5 additions and 3 deletions

View File

@@ -38,8 +38,7 @@ mod send_requests {
macro_rules! send_request {
($func:expr ) => {{
let handle = ::tokio::runtime::Handle::current();
let _ = handle.enter();
futures::executor::block_on($func)
handle.block_on($func)
}};
}
#[macro_export]

View File

@@ -55,7 +55,10 @@ async fn mount(
let _ = end_program_signal_awaiter(sender, session_ender).await;
});
debug!("Mounting fuse filesystem");
let _ = session.run();
tokio::task::spawn_blocking(move || {
let _ = session.run();
})
.await?;
debug!("Stopped with mounting");
// Ok(session_ender)
Ok(end_program_signal_handle)