mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
Fix condvar example
This commit is contained in:
parent
16362c737f
commit
ba6a6d0f0a
@ -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();
|
||||
/// });
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user