Fix condvar example

This commit is contained in:
Guillaume Gomez 2018-02-15 18:59:00 +01:00
parent 16362c737f
commit ba6a6d0f0a

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