diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-02-17 14:45:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-17 14:45:23 +0100 |
| commit | 3672caf662694b7d52ac77b26abb44af924ae934 (patch) | |
| tree | d69cff2c1c777713ccfad331e26fa8c8cd37cdbc /src/libstd | |
| parent | 62d6ba4638c0a4623f9aa703aa790da1380806d7 (diff) | |
| parent | ba6a6d0f0a047bc211e69bcbf0934ae6b651f415 (diff) | |
| download | rust-3672caf662694b7d52ac77b26abb44af924ae934.tar.gz rust-3672caf662694b7d52ac77b26abb44af924ae934.zip | |
Rollup merge of #48239 - GuillaumeGomez:fix-condvar-example, r=QuietMisdreavus
Fix condvar example Fixes #48230. r? @QuietMisdreavus
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sync/condvar.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 56402175817..54bb6513650 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -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(); /// }); /// |
