Skip to content

Conversation

@joboet
Copy link
Member

@joboet joboet commented Jan 23, 2026

This PR:

  • Forwards the public sleep_until to the private sleep_until on Motor OS
  • Adds a sleep_until implementation on VEX that yields until the deadline has passed

CC @lasiotus
CC @lewisfm @tropicaaal @Gavin-Niederman @max-niederman

@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 Jan 23, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 23, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

@lasiotus
Copy link
Contributor

This PR:

  • Forwards the public sleep_until to the private sleep_until on Motor OS

Thanks!

@lewisfm
Copy link
Contributor

lewisfm commented Jan 23, 2026

Regarding the changes to the VEX sleep impl, they are causing a segfault via null pointer dereference inside vexTaskSleep's internals when I run this program:

use vex_sdk_jumptable as _;
fn main() {
    sleep(Duration::from_secs(1));
}

It seems like vexTaskSleep is only valid to call from inside a VEXos task, which is a cooperative thread that is created by calling vexTaskAdd, polled by calling vexTasksRun, and yielded from by calling vexTaskSleep. (Some system processes like flushing I/O are implemented as tasks.)

I assume vexTaskSleep is trying to look up some field on the current task but finding it's a null pointer since there's no current task.

@tropicaaal
Copy link
Contributor

tropicaaal commented Jan 24, 2026

Can concur with Lewis - vexTaskSleep is exposed via the SDK for completeness reasons and can only be used within a cooperative task spawned via vexTaskAdd or similar. The scheduler API in the SDK exposed to user code is considered to be incomplete, so the vexos modules in std avoid using it as e.g. an implementation for thread entirely aside from vexTasksRun which is required to be called to tick some important OS-spawned tasks responsible for I/O.

@joboet
Copy link
Member Author

joboet commented Jan 24, 2026

Ah, alright, thanks for your responses! I've changed it back to the vexTasksRun-based version and added a specialised sleep_until instead.

@joboet joboet changed the title std: sleep and sleep_until improvements std: sleep_until on Motor and VEX Jan 24, 2026
@Mark-Simulacrum
Copy link
Member

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 24, 2026

📌 Commit dee0e39 has been approved by Mark-Simulacrum

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 Jan 24, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 24, 2026
Rollup of 11 pull requests

Successful merges:

 - #149962 (Promote powerpc64-unknown-linux-musl to tier 2 with host tools)
 - #150138 (Add new Tier 3 targets for ARMv6)
 - #150905 (Fix(lib/win/net): Remove hostname support under Win7)
 - #151094 (remote-test-server: Fix compilation on UEFI targets)
 - #151346 (add `simd_splat` intrinsic)
 - #151353 (compiletest: Make `aux-crate` directive explicitly handle `--extern` modifiers)
 - #151538 (std: `sleep_until` on Motor and VEX)
 - #151098 (Add Korean translation to Rust By Example)
 - #151157 (Extend build-manifest local test guide)
 - #151403 (std: use 64-bit `clock_nanosleep` on GNU/Linux if available)
 - #151571 (Fix cstring-merging test for Hexagon target)
@rust-bors rust-bors bot merged commit 275ffd5 into rust-lang:main Jan 25, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 25, 2026
rust-timer added a commit that referenced this pull request Jan 25, 2026
Rollup merge of #151538 - joboet:sleep_more, r=Mark-Simulacrum

std: `sleep_until` on Motor and VEX

This PR:
* Forwards the public `sleep_until` to the private `sleep_until` on Motor OS
* Adds a `sleep_until` implementation on VEX that yields until the deadline has passed

CC @lasiotus
CC @lewisfm @tropicaaal @Gavin-Niederman @max-niederman
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 25, 2026
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#149962 (Promote powerpc64-unknown-linux-musl to tier 2 with host tools)
 - rust-lang/rust#150138 (Add new Tier 3 targets for ARMv6)
 - rust-lang/rust#150905 (Fix(lib/win/net): Remove hostname support under Win7)
 - rust-lang/rust#151094 (remote-test-server: Fix compilation on UEFI targets)
 - rust-lang/rust#151346 (add `simd_splat` intrinsic)
 - rust-lang/rust#151353 (compiletest: Make `aux-crate` directive explicitly handle `--extern` modifiers)
 - rust-lang/rust#151538 (std: `sleep_until` on Motor and VEX)
 - rust-lang/rust#151098 (Add Korean translation to Rust By Example)
 - rust-lang/rust#151157 (Extend build-manifest local test guide)
 - rust-lang/rust#151403 (std: use 64-bit `clock_nanosleep` on GNU/Linux if available)
 - rust-lang/rust#151571 (Fix cstring-merging test for Hexagon target)
github-actions bot pushed a commit to rust-lang/stdarch that referenced this pull request Jan 26, 2026
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#149962 (Promote powerpc64-unknown-linux-musl to tier 2 with host tools)
 - rust-lang/rust#150138 (Add new Tier 3 targets for ARMv6)
 - rust-lang/rust#150905 (Fix(lib/win/net): Remove hostname support under Win7)
 - rust-lang/rust#151094 (remote-test-server: Fix compilation on UEFI targets)
 - rust-lang/rust#151346 (add `simd_splat` intrinsic)
 - rust-lang/rust#151353 (compiletest: Make `aux-crate` directive explicitly handle `--extern` modifiers)
 - rust-lang/rust#151538 (std: `sleep_until` on Motor and VEX)
 - rust-lang/rust#151098 (Add Korean translation to Rust By Example)
 - rust-lang/rust#151157 (Extend build-manifest local test guide)
 - rust-lang/rust#151403 (std: use 64-bit `clock_nanosleep` on GNU/Linux if available)
 - rust-lang/rust#151571 (Fix cstring-merging test for Hexagon target)
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jan 26, 2026
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#149962 (Promote powerpc64-unknown-linux-musl to tier 2 with host tools)
 - rust-lang/rust#150138 (Add new Tier 3 targets for ARMv6)
 - rust-lang/rust#150905 (Fix(lib/win/net): Remove hostname support under Win7)
 - rust-lang/rust#151094 (remote-test-server: Fix compilation on UEFI targets)
 - rust-lang/rust#151346 (add `simd_splat` intrinsic)
 - rust-lang/rust#151353 (compiletest: Make `aux-crate` directive explicitly handle `--extern` modifiers)
 - rust-lang/rust#151538 (std: `sleep_until` on Motor and VEX)
 - rust-lang/rust#151098 (Add Korean translation to Rust By Example)
 - rust-lang/rust#151157 (Extend build-manifest local test guide)
 - rust-lang/rust#151403 (std: use 64-bit `clock_nanosleep` on GNU/Linux if available)
 - rust-lang/rust#151571 (Fix cstring-merging test for Hexagon target)
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.

6 participants