mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
fix edge case where cancellation is not possible
This commit is contained in:
@@ -59,7 +59,12 @@ async fn capture_task(
|
||||
if server.is_cancelled() {
|
||||
break;
|
||||
}
|
||||
server.capture_notified().await;
|
||||
|
||||
// allow cancellation
|
||||
tokio::select! {
|
||||
_ = server.capture_notified() => {},
|
||||
_ = server.cancelled() => break,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,13 @@ async fn emulation_task(
|
||||
break;
|
||||
}
|
||||
log::info!("waiting for user to request input emulation ...");
|
||||
server.emulation_notified().await;
|
||||
|
||||
// allow cancellation
|
||||
tokio::select! {
|
||||
_ = server.emulation_notified() => {},
|
||||
_ = server.cancelled() => break,
|
||||
}
|
||||
|
||||
log::info!("... done");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user