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

EventLoop doesn't wake up reliably when setting control_flow to ControlFlow::WaitUntil #988

Open
dfaust opened this issue Oct 17, 2024 · 0 comments

Comments

@dfaust
Copy link

dfaust commented Oct 17, 2024

Describe the bug
When setting the control_flow argument of the closure passed to the EventLoop::run function to ControlFlow::WaitUntil, the event loop wakes up a couple of times and then stops until an event arrives.

Steps To Reproduce

use tao::event_loop::{ControlFlow, EventLoopBuilder};

fn main() {
    let event_loop = EventLoopBuilder::new().build();

    event_loop.run(move |event, _, control_flow| {
        *control_flow = ControlFlow::WaitUntil(
            std::time::Instant::now() + std::time::Duration::from_millis(16),
        );

        println!("poll");
    })
}

Expected behavior
The event loop should wake up after 16ms if no event arrives.

Platform and Versions (please complete the following information):
OS: Linux
Rustc: 1.83.0-nightly (9e394f551 2024-09-25)

Additional context
Happens with the current tao release and dev branch (commit c49b83a).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant