Skip to content

Commit 040be55

Browse files
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.
2 parents adcee23 + 96837dc commit 040be55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

library/std/src/sync/condvar.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,11 @@ impl Condvar {
195195
if poisoned { Err(PoisonError::new(guard)) } else { Ok(guard) }
196196
}
197197

198-
/// Blocks the current thread until this condition variable receives a
199-
/// notification and the provided condition is false.
198+
/// Blocks the current thread until the provided condition becomes false.
199+
///
200+
/// `condition` is checked immediately; if not met (returns `true`), this
201+
/// will [`wait`] for the next notification then check again. This repeats
202+
/// until `condition` returns `false`, in which case this function returns.
200203
///
201204
/// This function will atomically unlock the mutex specified (represented by
202205
/// `guard`) and block the current thread. This means that any calls
@@ -210,6 +213,7 @@ impl Condvar {
210213
/// poisoned when this thread re-acquires the lock. For more information,
211214
/// see information about [poisoning] on the [`Mutex`] type.
212215
///
216+
/// [`wait`]: Self::wait
213217
/// [`notify_one`]: Self::notify_one
214218
/// [`notify_all`]: Self::notify_all
215219
/// [poisoning]: super::Mutex#poisoning

0 commit comments

Comments
 (0)