clarify wording around spurious wakeups from thread::park

This commit is contained in:
Ibraheem Ahmed 2023-04-11 13:20:41 -04:00 committed by GitHub
parent 6e8a0136f1
commit e9868ef8df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -891,8 +891,8 @@ pub fn sleep(dur: Duration) {
/// performs the corresponding `Acquire` operation. Calls to `unpark` for the same /// performs the corresponding `Acquire` operation. Calls to `unpark` for the same
/// thread form a [release sequence]. /// thread form a [release sequence].
/// ///
/// Note that being unblocked does not imply synchronization with a call to `unpark`, /// Note that being unblocked does not imply a call was made to `unpark`, because
/// the wakeup could also be spurious. For example, a valid, but inefficient, /// wakeups can also be spurious. For example, a valid, but inefficient,
/// implementation could have `park` and `unpark` return immediately without doing anything. /// implementation could have `park` and `unpark` return immediately without doing anything.
/// ///
/// # Examples /// # Examples