Rollup merge of #48239 - GuillaumeGomez:fix-condvar-example, r=QuietMisdreavus

Fix condvar example

Fixes #48230.

r? @QuietMisdreavus
This commit is contained in:
Guillaume Gomez 2018-02-17 14:45:23 +01:00 committed by GitHub
commit 3672caf662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
/// });
///