Skip to content

Commit 3672caf

Browse files
Rollup merge of rust-lang#48239 - GuillaumeGomez:fix-condvar-example, r=QuietMisdreavus
Fix condvar example Fixes rust-lang#48230. r? @QuietMisdreavus
2 parents 62d6ba4 + ba6a6d0 commit 3672caf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libstd/sync/condvar.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ impl WaitTimeoutResult {
4747
///
4848
/// thread::spawn(move|| {
4949
/// let &(ref lock, ref cvar) = &*pair2;
50+
///
51+
/// // Let's wait 20 milliseconds before notifying the condvar.
52+
/// thread::sleep(Duration::from_millis(20));
53+
///
5054
/// let mut started = lock.lock().unwrap();
5155
/// // We update the boolean value.
5256
/// *started = true;
53-
/// // Let's wait 20 milliseconds before notifying the condvar.
54-
/// thread::sleep(Duration::from_millis(20));
5557
/// cvar.notify_one();
5658
/// });
5759
///

0 commit comments

Comments
 (0)