std: sys: xous: clamp condvar wait_timeout instead of truncating#157867
Merged
Conversation
dur.as_millis() (u128) was cast straight to usize, so on 32-bit xous any timeout over ~49 days truncated, and an exact multiple of 2^32 ms became 0 and then 1ms via the "don't wait forever" guard. Saturate the conversion, matching sys/sync/thread_parking/xous.rs.
Collaborator
|
r? @clarfonthey rustbot has assigned @clarfonthey. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
|
@bors r+ rollup Thank you! |
Contributor
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jun 13, 2026
… r=clarfonthey std: sys: xous: clamp condvar wait_timeout instead of truncating dur.as_millis() (u128) was cast straight to usize, so on 32-bit xous any timeout over ~49 days truncated, and an exact multiple of 2^32 ms became 0 and then 1ms via the "don't wait forever" guard. Saturate the conversion, matching sys/sync/thread_parking/xous.rs.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 13, 2026
Rollup of 4 pull requests Successful merges: - #155200 (Introduce #[diagnostic::on_type_error(message)]) - #157538 (std: move `PidFd` to `sys::process`) - #157791 (Add regression test for pclmulqdq inlining across target feature) - #157867 (std: sys: xous: clamp condvar wait_timeout instead of truncating)
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jun 14, 2026
… r=clarfonthey std: sys: xous: clamp condvar wait_timeout instead of truncating dur.as_millis() (u128) was cast straight to usize, so on 32-bit xous any timeout over ~49 days truncated, and an exact multiple of 2^32 ms became 0 and then 1ms via the "don't wait forever" guard. Saturate the conversion, matching sys/sync/thread_parking/xous.rs.
This was referenced Jun 14, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 14, 2026
Rollup of 5 pull requests Successful merges: - #157837 ([tiny] Remove some unecessary `.into()` calls) - #157538 (std: move `PidFd` to `sys::process`) - #157791 (Add regression test for pclmulqdq inlining across target feature) - #157867 (std: sys: xous: clamp condvar wait_timeout instead of truncating) - #157876 (Stabilize `#![feature(box_as_ptr)]`)
rust-timer
added a commit
that referenced
this pull request
Jun 14, 2026
Rollup merge of #157867 - devnexen:condvar_xous_timeout_fix, r=clarfonthey std: sys: xous: clamp condvar wait_timeout instead of truncating dur.as_millis() (u128) was cast straight to usize, so on 32-bit xous any timeout over ~49 days truncated, and an exact multiple of 2^32 ms became 0 and then 1ms via the "don't wait forever" guard. Saturate the conversion, matching sys/sync/thread_parking/xous.rs.
pull Bot
pushed a commit
to xtqqczze/rust-lang-miri
that referenced
this pull request
Jun 15, 2026
Rollup of 5 pull requests Successful merges: - rust-lang/rust#157837 ([tiny] Remove some unecessary `.into()` calls) - rust-lang/rust#157538 (std: move `PidFd` to `sys::process`) - rust-lang/rust#157791 (Add regression test for pclmulqdq inlining across target feature) - rust-lang/rust#157867 (std: sys: xous: clamp condvar wait_timeout instead of truncating) - rust-lang/rust#157876 (Stabilize `#![feature(box_as_ptr)]`)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dur.as_millis() (u128) was cast straight to usize, so on 32-bit xous any timeout over ~49 days truncated, and an exact multiple of 2^32 ms became 0 and then 1ms via the "don't wait forever" guard. Saturate the conversion, matching sys/sync/thread_parking/xous.rs.