Cancel fix
This commit is contained in:
@@ -80,10 +80,12 @@ impl CancelFlag {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub async fn await_cancel(&self) {
|
pub async fn await_cancel(&self) {
|
||||||
if self.is_cancelled() {
|
let notified = self.notify.notified();
|
||||||
return;
|
tokio::pin!(notified);
|
||||||
|
notified.as_mut().enable();
|
||||||
|
if !self.is_cancelled() {
|
||||||
|
notified.await;
|
||||||
}
|
}
|
||||||
self.notify.notified().await;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
Reference in New Issue
Block a user