mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
Rollup merge of #48239 - GuillaumeGomez:fix-condvar-example, r=QuietMisdreavus
Fix condvar example Fixes #48230. r? @QuietMisdreavus
This commit is contained in:
commit
3672caf662
@ -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