@@ -878,8 +878,34 @@ pub fn sleep(dur: Duration) {
878
878
///
879
879
/// # Platform-specific behavior
880
880
///
881
- /// This function uses [`sleep`] internally, see its platform-specific behavior.
881
+ /// In most cases this function will call an OS specific function. Where that
882
+ /// is not supported [`sleep`] is used. Those platforms are referred to as other
883
+ /// in the table below.
882
884
///
885
+ /// # Underlying System calls
886
+ ///
887
+ /// The following system calls are [currently] being used:
888
+ ///
889
+ ///
890
+ /// | Platform | System call |
891
+ /// |-----------|----------------------------------------------------------------------|
892
+ /// | Linux | [clock_nanosleep] (Monotonic clock) |
893
+ /// | BSD except OpenBSD | [clock_nanosleep] (Monotonic Clock)] |
894
+ /// | Android | [clock_nanosleep] (Monotonic Clock)] |
895
+ /// | Solaris | [clock_nanosleep] (Monotonic Clock)] |
896
+ /// | Illumos | [clock_nanosleep] (Monotonic Clock)] |
897
+ /// | Darwin | [mach_wait_until] |
898
+ /// | WASI | [subscription_clock] |
899
+ /// | Windows | [SetWaitableTimer] |
900
+ /// | Other | `sleep_until` uses [`sleep`] and does not issue a syscall itself |
901
+ ///
902
+ /// [currently]: crate::io#platform-specific-behavior
903
+ /// [clock_nanosleep]: https://linux.die.net/man/3/clock_nanosleep
904
+ /// [subscription_clock]: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#-subscription_clock-record
905
+ /// [mach_wait_until]: https://developer.apple.com/library/archive/technotes/tn2169/_index.html
906
+ /// [SetWaitableTimer]: https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-setwaitabletimer
907
+ ///
908
+ /// **Disclaimer:** These system calls might change over time.
883
909
///
884
910
/// # Examples
885
911
///
@@ -904,9 +930,9 @@ pub fn sleep(dur: Duration) {
904
930
/// }
905
931
/// ```
906
932
///
907
- /// A slow api we must not call too fast and which takes a few
933
+ /// A slow API we must not call too fast and which takes a few
908
934
/// tries before succeeding. By using `sleep_until` the time the
909
- /// api call takes does not influence when we retry or when we give up
935
+ /// API call takes does not influence when we retry or when we give up
910
936
///
911
937
/// ```no_run
912
938
/// #![feature(thread_sleep_until)]
0 commit comments