about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-02-15 18:59:00 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2018-02-15 19:00:51 +0100
commitba6a6d0f0a047bc211e69bcbf0934ae6b651f415 (patch)
tree0c6009307ed314b463a5f2c39aa59911a002cb5a /src/libstd/sync
parent16362c737fe740f630ada06349fa9004e2a51bb7 (diff)
downloadrust-ba6a6d0f0a047bc211e69bcbf0934ae6b651f415.tar.gz
rust-ba6a6d0f0a047bc211e69bcbf0934ae6b651f415.zip
Fix condvar example
Diffstat (limited to 'src/libstd/sync')
-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();
     /// });
     ///