mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-02 18:01:28 +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() {
|
if server.is_cancelled() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
server.capture_notified().await;
|
|
||||||
|
// allow cancellation
|
||||||
|
tokio::select! {
|
||||||
|
_ = server.capture_notified() => {},
|
||||||
|
_ = server.cancelled() => break,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,13 @@ async fn emulation_task(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
log::info!("waiting for user to request input emulation ...");
|
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");
|
log::info!("... done");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user