Skip to content

Commit 7a0fa95

Browse files
author
Vasya Novikov
committed
improve docs on thread::sleep
1 parent b63517a commit 7a0fa95

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/libstd/thread/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,10 @@ pub fn panicking() -> bool {
657657
///
658658
/// # Platform-specific behavior
659659
///
660-
/// On Unix platforms this function may invoke multiple syscalls
661-
/// in case of a signal being received or a spurious wakeup.
660+
/// On Unix platforms, the underlying syscall may be interrupted by a
661+
/// spurious wakeup or signal handler. To ensure the sleep occurs for at least
662+
/// the specified duration, this function may invoke that system call multiple
663+
/// times.
662664
///
663665
/// # Examples
664666
///
@@ -681,8 +683,10 @@ pub fn sleep_ms(ms: u32) {
681683
///
682684
/// # Platform-specific behavior
683685
///
684-
/// On Unix platforms this function may invoke multiple syscalls
685-
/// in case of a signal being received or a spurious wakeup.
686+
/// On Unix platforms, the underlying syscall may be interrupted by a
687+
/// spurious wakeup or signal handler. To ensure the sleep occurs for at least
688+
/// the specified duration, this function may invoke that system call multiple
689+
/// times.
686690
/// Platforms which do not support nanosecond precision for sleeping will
687691
/// have `dur` rounded up to the nearest granularity of time they can sleep for.
688692
///

0 commit comments

Comments
 (0)