about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-07 14:21:20 +0300
committerGitHub <noreply@github.com>2024-09-07 14:21:20 +0300
commit040be55550d00f10ee81066b422e4ed5de9c63bd (patch)
treeeae1d730d5ab1506a24e5bc945ba86ef7f8d25cc
parentadcee23a95ebc7c57edb303a8829d4fb53c6f93d (diff)
parent96837dcade77185d270c90326f000fc057c29a8e (diff)
downloadrust-040be55550d00f10ee81066b422e4ed5de9c63bd.tar.gz
rust-040be55550d00f10ee81066b422e4ed5de9c63bd.zip
Rollup merge of #129614 - rawler:patch-1, r=tgross35
Adjust doc comment of Condvar::wait_while

The existing phrasing implies that a notification must be received for `wait_while` to return. The phrasing is changed to make no such implication.
-rw-r--r--library/std/src/sync/condvar.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/std/src/sync/condvar.rs b/library/std/src/sync/condvar.rs
index 08d46f356d9..e41cbc1a65c 100644
--- a/library/std/src/sync/condvar.rs
+++ b/library/std/src/sync/condvar.rs
@@ -195,8 +195,11 @@ impl Condvar {
         if poisoned { Err(PoisonError::new(guard)) } else { Ok(guard) }
     }
 
-    /// Blocks the current thread until this condition variable receives a
-    /// notification and the provided condition is false.
+    /// Blocks the current thread until the provided condition becomes false.
+    ///
+    /// `condition` is checked immediately; if not met (returns `true`), this
+    /// will [`wait`] for the next notification then check again. This repeats
+    /// until `condition` returns `false`, in which case this function returns.
     ///
     /// This function will atomically unlock the mutex specified (represented by
     /// `guard`) and block the current thread. This means that any calls
@@ -210,6 +213,7 @@ impl Condvar {
     /// poisoned when this thread re-acquires the lock. For more information,
     /// see information about [poisoning] on the [`Mutex`] type.
     ///
+    /// [`wait`]: Self::wait
     /// [`notify_one`]: Self::notify_one
     /// [`notify_all`]: Self::notify_all
     /// [poisoning]: super::Mutex#poisoning