about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-02-17 14:45:23 +0100
committerGitHub <noreply@github.com>2018-02-17 14:45:23 +0100
commit3672caf662694b7d52ac77b26abb44af924ae934 (patch)
treed69cff2c1c777713ccfad331e26fa8c8cd37cdbc /src/libstd
parent62d6ba4638c0a4623f9aa703aa790da1380806d7 (diff)
parentba6a6d0f0a047bc211e69bcbf0934ae6b651f415 (diff)
downloadrust-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.rs6
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();
     /// });
     ///