aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-12 13:07:34 +0200
committerAlex Auvolat <alex@adnab.me>2021-10-12 13:07:34 +0200
commit7753b789b7aca87db4db7aed20e79a41ecb0b225 (patch)
treef5b67a3d52736eb60d88cdd8772957ada62654fb /src/util.rs
parent90f8fb28361cba1087a0e608e8a8deb6abb5bd39 (diff)
downloadnetapp-7753b789b7aca87db4db7aed20e79a41ecb0b225.tar.gz
netapp-7753b789b7aca87db4db7aed20e79a41ecb0b225.zip
Upgrade to tokio 1.0
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.rs b/src/util.rs
index faeea79..ba485bf 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -32,9 +32,9 @@ where
/// )
/// ```
pub async fn await_exit(mut must_exit: watch::Receiver<bool>) {
- loop {
- if must_exit.recv().await == Some(true) {
- return;
+ while !*must_exit.borrow_and_update() {
+ if must_exit.changed().await.is_err() {
+ break;
}
}
}