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
Specialize sleep_until implementation #118480
base: master
Are you sure you want to change the base?
Conversation
r? @cuviper (rustbot has picked a reviewer for you, use r? to override) |
Not ready for review, however I need CI to run. |
We don't have a configured way to try full CI, but you can copy specific jobs from rust/src/ci/github-actions/ci.yml Line 319 in b10cfcd
Then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this on my local macOS machine. While the implementation works, the test currently fails because its success margin is too small.
@@ -943,11 +943,7 @@ pub fn sleep(dur: Duration) { | |||
/// ``` | |||
#[unstable(feature = "thread_sleep_until", issue = "113752")] | |||
pub fn sleep_until(deadline: Instant) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The section on platform-specific behaviour still needs updating.
☔ The latest upstream changes (presumably #116565) made this pull request unmergeable. Please resolve the merge conflicts. |
558a3e4
to
7ace020
Compare
7ace020
to
1e36e08
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5470a7c
to
a0f50b6
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #117285) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm clearing this from my queue while it's in draft, but you can use @rustbot author |
@dvdsk any updates on this pr? thanks |
I had to put this on the back burner while moving. If I remember correctly only the windows test was not working. Got some hours today, lets see if I can change that. Then this should be ready to merge. So, kinda stuck on getting the std tests working on a windows VM (something complaining about llvm...). Once I have some time im gonna ask someone to have a look with me. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #121185) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #121549) made this pull request unmergeable. Please resolve the merge conflicts. |
The CI changes where ment for testing, that didnt work out. I do not really get the library/stdarch and tools/cargo bit. Trying to reset that to master with this commit
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #121904) made this pull request unmergeable. Please resolve the merge conflicts. |
} | ||
} | ||
|
||
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
visionOS was added in #121419.
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] | |
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))] |
Same goes for the other cfgs.
let info = info.assume_init(); | ||
let ticks = nanos * (info.denom as u64) / (info.numer as u64); | ||
|
||
mach_wait_until(ticks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually check the return type of mach_wait_until
.
mach_wait_until(ticks); | |
let ret = mach_wait_until(ticks); |
#[cfg(any( | ||
target_os = "freebsd", | ||
target_os = "netbsd", | ||
target_os = "linux", | ||
target_os = "android", | ||
target_os = "solaris", | ||
target_os = "illumos", | ||
))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add target_os = "dragonfly"
, target_os = "hurd"
and target_os = "fuchsia"
Draft (I need the CI tests, which will probably fail)
related tracking issue: #113752
Replaces the generic catch all implementation with
target_os
specific ones for: linux/netbsd/freebsd/android/solaris/illumos, wasi, macos/ios/tvos/watchos and windows.Points of attention:
extern "C"
calls tomach_wait_until
andmach_timebase_info
for macos etc. We could also import them from the mach2 crate, but then we depend on mach2 and we need to modify mach2 to work as an std dep (adding a featurerustc-dep-of-std
).target_os
specific details of the Instant type. For that I added an into_inner and made some fields public. Is there a neater way?