Skip to content

std: sys: xous: clamp condvar wait_timeout instead of truncating#157867

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
devnexen:condvar_xous_timeout_fix
Jun 14, 2026
Merged

std: sys: xous: clamp condvar wait_timeout instead of truncating#157867
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
devnexen:condvar_xous_timeout_fix

Conversation

@devnexen

Copy link
Copy Markdown
Contributor

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.

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.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 13, 2026
@rustbot

rustbot commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

r? @clarfonthey

rustbot has assigned @clarfonthey.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 11 candidates
  • Random selection from 6 candidates

@clarfonthey

Copy link
Copy Markdown
Contributor

@bors r+ rollup

Thank you!

@rust-bors

rust-bors Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 5f65b74 has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 13, 2026
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.
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-bors rust-bors Bot merged commit 4ffea22 into rust-lang:main Jun 14, 2026
13 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 14, 2026
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)]`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants