Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: fix wake-up with interval on Ready #5553

Merged

Commits on Mar 17, 2023

  1. time: fix wake-up with interval on Ready (tokio-rs#5551)

    When `tokio::time::Interval::poll_tick()` returns `Poll::Pending`, it
    schedules itself for being woken up again through the waker of the
    passed context, which is correct behavior.
    
    However when `Poll::Ready(_)` is returned, the interval timer should be
    reset but not scheduled to be woken up again as this is up to the
    caller.
    
    This commit fixes the bug by introducing a `reset_without_reregister`
    method on `TimerEntry` which is called by `Intervall::poll_tick(cx)` in
    case the delay poll returns `Poll::Ready(_)`.
    sgasse committed Mar 17, 2023
    Copy the full SHA
    8dffc8d View commit details
    Browse the repository at this point in the history