@@ -893,7 +893,8 @@ pub fn sleep(dur: Duration) {
893893///
894894/// Note that being unblocked does not imply a call was made to `unpark`, because
895895/// wakeups can also be spurious. For example, a valid, but inefficient,
896- /// implementation could have `park` and `unpark` return immediately without doing anything.
896+ /// implementation could have `park` and `unpark` return immediately without doing anything,
897+ /// making *all* wakeups spurious.
897898///
898899/// # Examples
899900///
@@ -908,7 +909,7 @@ pub fn sleep(dur: Duration) {
908909/// let parked_thread = thread::spawn(move || {
909910/// // We want to wait until the flag is set. We *could* just spin, but using
910911/// // park/unpark is more efficient.
911- /// while !flag2.load(Ordering::Acquire ) {
912+ /// while !flag2.load(Ordering::Relaxed ) {
912913/// println!("Parking thread");
913914/// thread::park();
914915/// // We *could* get here spuriously, i.e., way before the 10ms below are over!
@@ -925,7 +926,7 @@ pub fn sleep(dur: Duration) {
925926/// // There is no race condition here, if `unpark`
926927/// // happens first, `park` will return immediately.
927928/// // Hence there is no risk of a deadlock.
928- /// flag.store(true, Ordering::Release );
929+ /// flag.store(true, Ordering::Relaxed );
929930/// println!("Unpark the thread");
930931/// parked_thread.thread().unpark();
931932///
0 commit comments