Skip to content

Commit

Permalink
Rollup merge of rust-lang#48239 - GuillaumeGomez:fix-condvar-example,…
Browse files Browse the repository at this point in the history
… r=QuietMisdreavus

Fix condvar example

Fixes rust-lang#48230.

r? @QuietMisdreavus
  • Loading branch information
GuillaumeGomez authored Feb 17, 2018
2 parents 62d6ba4 + ba6a6d0 commit 3672caf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libstd/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ impl WaitTimeoutResult {
///
/// thread::spawn(move|| {
/// let &(ref lock, ref cvar) = &*pair2;
///
/// // Let's wait 20 milliseconds before notifying the condvar.
/// thread::sleep(Duration::from_millis(20));
///
/// let mut started = lock.lock().unwrap();
/// // We update the boolean value.
/// *started = true;
/// // Let's wait 20 milliseconds before notifying the condvar.
/// thread::sleep(Duration::from_millis(20));
/// cvar.notify_one();
/// });
///
Expand Down

0 comments on commit 3672caf

Please sign in to comment.