Cancel fix

This commit is contained in:
2026-03-16 22:24:39 -07:00
parent 053459f340
commit 1c1c47f5b2

View File

@@ -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]