about summary refs log tree commit diff
path: root/library/std/src/sync/nonpoison/condvar.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-13 23:02:12 +0000
committerbors <bors@rust-lang.org>2025-09-13 23:02:12 +0000
commita015919e54c60b1b2bec7a98dec478cfc4a48f4e (patch)
tree8a1fc4a0c27ec87edc0d0449bb4fa3dab130bab6 /library/std/src/sync/nonpoison/condvar.rs
parent02c7b1a7ac1d739663878030510508372e46f254 (diff)
parentda1c27df16075d9ebb28a94cf9b400e89c476233 (diff)
downloadrust-a015919e54c60b1b2bec7a98dec478cfc4a48f4e.tar.gz
rust-a015919e54c60b1b2bec7a98dec478cfc4a48f4e.zip
Auto merge of #146526 - jhpratt:rollup-afb1dgo, r=jhpratt
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#113095 (Document `become` keyword)
 - rust-lang/rust#146159 (Some hygiene doc improvements)
 - rust-lang/rust#146171 (tidy: check that error messages don't start with a capitalized letter)
 - rust-lang/rust#146419 (Update the arm-* and aarch64-* platform docs.)
 - rust-lang/rust#146473 (Revert "Constify SystemTime methods")
 - rust-lang/rust#146506 (Fix small typo in check-cfg.md)
 - rust-lang/rust#146517 (fix Condvar::wait_timeout docs)
 - rust-lang/rust#146521 (document `core::ffi::VaArgSafe`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sync/nonpoison/condvar.rs')
-rw-r--r--library/std/src/sync/nonpoison/condvar.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/library/std/src/sync/nonpoison/condvar.rs b/library/std/src/sync/nonpoison/condvar.rs
index 49afdd87818..994fc6816a0 100644
--- a/library/std/src/sync/nonpoison/condvar.rs
+++ b/library/std/src/sync/nonpoison/condvar.rs
@@ -198,11 +198,10 @@ impl Condvar {
     /// the system time. This function is susceptible to spurious wakeups.
     /// Condition variables normally have a boolean predicate associated with
     /// them, and the predicate must always be checked each time this function
-    /// returns to protect against spurious wakeups. Additionally, it is
-    /// typically desirable for the timeout to not exceed some duration in
-    /// spite of spurious wakes, thus the sleep-duration is decremented by the
-    /// amount slept. Alternatively, use the `wait_timeout_while` method
-    /// to wait with a timeout while a predicate is true.
+    /// returns to protect against spurious wakeups.  Furthermore, since the timeout
+    /// is given relative to the moment this function is called, it needs to be adjusted
+    /// when this function is called in a loop. The [`wait_timeout_while`] method
+    /// lets you wait with a timeout while a predicate is true, taking care of all these concerns.
     ///
     /// The returned [`WaitTimeoutResult`] value indicates if the timeout is
     /// known to have elapsed.