1
Fork 0

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.
This commit is contained in:
Michael Goulet 2024-09-07 14:21:20 +03:00 committed by GitHub
commit 040be55550
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -195,8 +195,11 @@ impl Condvar {
if poisoned { Err(PoisonError::new(guard)) } else { Ok(guard) } if poisoned { Err(PoisonError::new(guard)) } else { Ok(guard) }
} }
/// Blocks the current thread until this condition variable receives a /// Blocks the current thread until the provided condition becomes false.
/// notification and the provided condition is 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 /// This function will atomically unlock the mutex specified (represented by
/// `guard`) and block the current thread. This means that any calls /// `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, /// poisoned when this thread re-acquires the lock. For more information,
/// see information about [poisoning] on the [`Mutex`] type. /// see information about [poisoning] on the [`Mutex`] type.
/// ///
/// [`wait`]: Self::wait
/// [`notify_one`]: Self::notify_one /// [`notify_one`]: Self::notify_one
/// [`notify_all`]: Self::notify_all /// [`notify_all`]: Self::notify_all
/// [poisoning]: super::Mutex#poisoning /// [poisoning]: super::Mutex#poisoning