-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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.
☔ The latest upstream changes (presumably #116565) made this pull request unmergeable. Please resolve the merge conflicts. |
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 |
mostly some misery I had with the submodules causing the merges to not become fast forwards. The commit history is a bit ugly anyway. Ill see if I can clean that up later, maybe just squash it all done to one or two commits. |
let info = info.assume_init(); | ||
let ticks = nanos * (info.denom as u64) / (info.numer as u64); | ||
|
||
let ret = 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.
mach_wait_until
can be interrupted by signals just like clock_nanosleep
, so this should check if ret
is KERN_ABORTED
(14) and retry in that case.
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.
thanks for finding that out 👍 And nice to read (the stack overflow link) I am not the only one that struggled to find any details on mach_wait_until
d59d09d
to
bf0ebb9
Compare
bf0ebb9
to
61439b2
Compare
This comment has been minimized.
This comment has been minimized.
It is not working and I can not figure out why. Since I am not familiar with developing on windows I might not be the best person to work on this. The work removed in this commit might be a useful jumping off point for anyone else however.
more unix platforms target_vendor's done by: Co-authored-by: Jonas Böttiger <[email protected]>
61439b2
to
bbb93cb
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a88ec6d
to
00f5d5b
Compare
@rustbot ready |
☔ The latest upstream changes (presumably #129809) made this pull request unmergeable. Please resolve the merge conflicts. |
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?