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