Merge pull request #1643 from bugadani/clear_timer

Reset `expires_at` of finished task
This commit is contained in:
Dario Nieuwenhuis 2023-07-12 15:40:10 +00:00 committed by GitHub
commit a615a70eda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,6 +165,9 @@ impl<F: Future + 'static> TaskStorage<F> {
Poll::Ready(_) => {
this.future.drop_in_place();
this.raw.state.fetch_and(!STATE_SPAWNED, Ordering::AcqRel);
#[cfg(feature = "integrated-timers")]
this.raw.expires_at.set(Instant::MAX);
}
Poll::Pending => {}
}