-
Notifications
You must be signed in to change notification settings - Fork 13.3k
pal/hermit: correctly round up microseconds in Thread::sleep
#129588
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
Conversation
Signed-off-by: Martin Kröning <[email protected]>
Yup! |
I assume hermit here is assessed as not having to do the "repeatedly call the underlying sleep fn" thing because it has 64-bit usleep? What if |
granted, perhaps sleeping accuracy over... uh, would it be... 500,000 years?... is not a concern. |
...actually, it IS a little bit of a concern: if someone inputs a really absurd |
That is still only relevant to vampires writing Rust code to manage their wakeup alarms for torpor, but can you imagine how cranky someone would be if they woke up a hundred thousand years early? Probably we should respec Duration in such a way that people don't have to worry about this absurdity, or introduce a new type and make |
Signed-off-by: Martin Kröning <[email protected]>
Thanks for the quick review! I pushed a commit to saturate the conversion. :) |
Cool, thanks! @bors r+ rollup |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#129190 (Add f16 and f128 to tests/ui/consts/const-float-bits-conv.rs) - rust-lang#129377 (Add implementations for `unbounded_shl`/`unbounded_shr`) - rust-lang#129539 (link to Future::poll from the Poll docs) - rust-lang#129588 (pal/hermit: correctly round up microseconds in `Thread::sleep`) - rust-lang#129592 (Remove cfg(test) from library/core) - rust-lang#129597 (mv `build_reduced_graph_for_external_crate_res` into Resolver) - rust-lang#129600 (Tie `impl_trait_overcaptures` lint to Rust 2024) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#129190 (Add f16 and f128 to tests/ui/consts/const-float-bits-conv.rs) - rust-lang#129377 (Add implementations for `unbounded_shl`/`unbounded_shr`) - rust-lang#129539 (link to Future::poll from the Poll docs) - rust-lang#129588 (pal/hermit: correctly round up microseconds in `Thread::sleep`) - rust-lang#129592 (Remove cfg(test) from library/core) - rust-lang#129597 (mv `build_reduced_graph_for_external_crate_res` into Resolver) - rust-lang#129600 (Tie `impl_trait_overcaptures` lint to Rust 2024) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#129588 - hermit-os:sleep-micros, r=workingjubilee pal/hermit: correctly round up microseconds in `Thread::sleep` This fixes the Hermit-related part of rust-lang#129212 and thus the whole issue, since ESP-IDF is already fixed, as far as I understand. Fixes rust-lang#129212 r? `@workingjubilee` CC: `@stlankes`
This fixes the Hermit-related part of #129212 and thus the whole issue, since ESP-IDF is already fixed, as far as I understand.
Fixes #129212
r? @workingjubilee
CC: @stlankes