@@ -36,7 +36,7 @@ impl WaitTimeoutResult {
36
36
/// let pair2 = pair.clone();
37
37
///
38
38
/// thread::spawn(move|| {
39
- /// let &(ref lock, ref cvar) = &*pair2;
39
+ /// let ( lock, cvar) = &*pair2;
40
40
///
41
41
/// // Let's wait 20 milliseconds before notifying the condvar.
42
42
/// thread::sleep(Duration::from_millis(20));
@@ -48,7 +48,7 @@ impl WaitTimeoutResult {
48
48
/// });
49
49
///
50
50
/// // Wait for the thread to start up.
51
- /// let &(ref lock, ref cvar) = &*pair;
51
+ /// let ( lock, cvar) = &*pair;
52
52
/// let mut started = lock.lock().unwrap();
53
53
/// loop {
54
54
/// // Let's put a timeout on the condvar's wait.
@@ -94,15 +94,15 @@ impl WaitTimeoutResult {
94
94
///
95
95
/// // Inside of our lock, spawn a new thread, and then wait for it to start.
96
96
/// thread::spawn(move|| {
97
- /// let &(ref lock, ref cvar) = &*pair2;
97
+ /// let ( lock, cvar) = &*pair2;
98
98
/// let mut started = lock.lock().unwrap();
99
99
/// *started = true;
100
100
/// // We notify the condvar that the value has changed.
101
101
/// cvar.notify_one();
102
102
/// });
103
103
///
104
104
/// // Wait for the thread to start up.
105
- /// let &(ref lock, ref cvar) = &*pair;
105
+ /// let ( lock, cvar) = &*pair;
106
106
/// let mut started = lock.lock().unwrap();
107
107
/// while !*started {
108
108
/// started = cvar.wait(started).unwrap();
@@ -180,15 +180,15 @@ impl Condvar {
180
180
/// let pair2 = pair.clone();
181
181
///
182
182
/// thread::spawn(move|| {
183
- /// let &(ref lock, ref cvar) = &*pair2;
183
+ /// let ( lock, cvar) = &*pair2;
184
184
/// let mut started = lock.lock().unwrap();
185
185
/// *started = true;
186
186
/// // We notify the condvar that the value has changed.
187
187
/// cvar.notify_one();
188
188
/// });
189
189
///
190
190
/// // Wait for the thread to start up.
191
- /// let &(ref lock, ref cvar) = &*pair;
191
+ /// let ( lock, cvar) = &*pair;
192
192
/// let mut started = lock.lock().unwrap();
193
193
/// // As long as the value inside the `Mutex<bool>` is `false`, we wait.
194
194
/// while !*started {
@@ -245,15 +245,15 @@ impl Condvar {
245
245
/// let pair2 = pair.clone();
246
246
///
247
247
/// thread::spawn(move|| {
248
- /// let &(ref lock, ref cvar) = &*pair2;
248
+ /// let ( lock, cvar) = &*pair2;
249
249
/// let mut started = lock.lock().unwrap();
250
250
/// *started = true;
251
251
/// // We notify the condvar that the value has changed.
252
252
/// cvar.notify_one();
253
253
/// });
254
254
///
255
255
/// // Wait for the thread to start up.
256
- /// let &(ref lock, ref cvar) = &*pair;
256
+ /// let ( lock, cvar) = &*pair;
257
257
/// // As long as the value inside the `Mutex<bool>` is `false`, we wait.
258
258
/// let _guard = cvar.wait_until(lock.lock().unwrap(), |started| { *started }).unwrap();
259
259
/// ```
@@ -301,15 +301,15 @@ impl Condvar {
301
301
/// let pair2 = pair.clone();
302
302
///
303
303
/// thread::spawn(move|| {
304
- /// let &(ref lock, ref cvar) = &*pair2;
304
+ /// let ( lock, cvar) = &*pair2;
305
305
/// let mut started = lock.lock().unwrap();
306
306
/// *started = true;
307
307
/// // We notify the condvar that the value has changed.
308
308
/// cvar.notify_one();
309
309
/// });
310
310
///
311
311
/// // Wait for the thread to start up.
312
- /// let &(ref lock, ref cvar) = &*pair;
312
+ /// let ( lock, cvar) = &*pair;
313
313
/// let mut started = lock.lock().unwrap();
314
314
/// // As long as the value inside the `Mutex<bool>` is `false`, we wait.
315
315
/// loop {
@@ -374,15 +374,15 @@ impl Condvar {
374
374
/// let pair2 = pair.clone();
375
375
///
376
376
/// thread::spawn(move|| {
377
- /// let &(ref lock, ref cvar) = &*pair2;
377
+ /// let ( lock, cvar) = &*pair2;
378
378
/// let mut started = lock.lock().unwrap();
379
379
/// *started = true;
380
380
/// // We notify the condvar that the value has changed.
381
381
/// cvar.notify_one();
382
382
/// });
383
383
///
384
384
/// // wait for the thread to start up
385
- /// let &(ref lock, ref cvar) = &*pair;
385
+ /// let ( lock, cvar) = &*pair;
386
386
/// let mut started = lock.lock().unwrap();
387
387
/// // as long as the value inside the `Mutex<bool>` is `false`, we wait
388
388
/// loop {
@@ -449,15 +449,15 @@ impl Condvar {
449
449
/// let pair2 = pair.clone();
450
450
///
451
451
/// thread::spawn(move|| {
452
- /// let &(ref lock, ref cvar) = &*pair2;
452
+ /// let ( lock, cvar) = &*pair2;
453
453
/// let mut started = lock.lock().unwrap();
454
454
/// *started = true;
455
455
/// // We notify the condvar that the value has changed.
456
456
/// cvar.notify_one();
457
457
/// });
458
458
///
459
459
/// // wait for the thread to start up
460
- /// let &(ref lock, ref cvar) = &*pair;
460
+ /// let ( lock, cvar) = &*pair;
461
461
/// let result = cvar.wait_timeout_until(
462
462
/// lock.lock().unwrap(),
463
463
/// Duration::from_millis(100),
@@ -508,15 +508,15 @@ impl Condvar {
508
508
/// let pair2 = pair.clone();
509
509
///
510
510
/// thread::spawn(move|| {
511
- /// let &(ref lock, ref cvar) = &*pair2;
511
+ /// let ( lock, cvar) = &*pair2;
512
512
/// let mut started = lock.lock().unwrap();
513
513
/// *started = true;
514
514
/// // We notify the condvar that the value has changed.
515
515
/// cvar.notify_one();
516
516
/// });
517
517
///
518
518
/// // Wait for the thread to start up.
519
- /// let &(ref lock, ref cvar) = &*pair;
519
+ /// let ( lock, cvar) = &*pair;
520
520
/// let mut started = lock.lock().unwrap();
521
521
/// // As long as the value inside the `Mutex<bool>` is `false`, we wait.
522
522
/// while !*started {
@@ -548,15 +548,15 @@ impl Condvar {
548
548
/// let pair2 = pair.clone();
549
549
///
550
550
/// thread::spawn(move|| {
551
- /// let &(ref lock, ref cvar) = &*pair2;
551
+ /// let ( lock, cvar) = &*pair2;
552
552
/// let mut started = lock.lock().unwrap();
553
553
/// *started = true;
554
554
/// // We notify the condvar that the value has changed.
555
555
/// cvar.notify_all();
556
556
/// });
557
557
///
558
558
/// // Wait for the thread to start up.
559
- /// let &(ref lock, ref cvar) = &*pair;
559
+ /// let ( lock, cvar) = &*pair;
560
560
/// let mut started = lock.lock().unwrap();
561
561
/// // As long as the value inside the `Mutex<bool>` is `false`, we wait.
562
562
/// while !*started {
0 commit comments