|
9 | 9 | //! # Usage
|
10 | 10 | //!
|
11 | 11 | //! [`channel`] returns a [`Sender`] / [`Receiver`] pair. These are the producer
|
12 |
| -//! and sender halves of the channel. The channel is created with an initial |
| 12 | +//! and consumer halves of the channel. The channel is created with an initial |
13 | 13 | //! value. The **latest** value stored in the channel is accessed with
|
14 | 14 | //! [`Receiver::borrow()`]. Awaiting [`Receiver::changed()`] waits for a new
|
15 |
| -//! value to sent by the [`Sender`] half. |
| 15 | +//! value to be sent by the [`Sender`] half. |
16 | 16 | //!
|
17 | 17 | //! # Examples
|
18 | 18 | //!
|
@@ -90,10 +90,11 @@ pub struct Sender<T> {
|
90 | 90 | /// Returns a reference to the inner value.
|
91 | 91 | ///
|
92 | 92 | /// Outstanding borrows hold a read lock on the inner value. This means that
|
93 |
| -/// long lived borrows could cause the produce half to block. It is recommended |
94 |
| -/// to keep the borrow as short lived as possible. Additionally, if you are |
| 93 | +/// long-lived borrows could cause the producer half to block. It is recommended |
| 94 | +/// to keep the borrow as short-lived as possible. Additionally, if you are |
95 | 95 | /// running in an environment that allows `!Send` futures, you must ensure that
|
96 |
| -/// the returned `Ref` type is never held alive across an `.await` point. |
| 96 | +/// the returned `Ref` type is never held alive across an `.await` point, |
| 97 | +/// otherwise, it can lead to a deadlock. |
97 | 98 | ///
|
98 | 99 | /// The priority policy of the lock is dependent on the underlying lock
|
99 | 100 | /// implementation, and this type does not guarantee that any particular policy
|
@@ -350,11 +351,12 @@ impl<T> Receiver<T> {
|
350 | 351 | /// [`changed`] may return immediately even if you have already seen the
|
351 | 352 | /// value with a call to `borrow`.
|
352 | 353 | ///
|
353 |
| - /// Outstanding borrows hold a read lock. This means that long lived borrows |
354 |
| - /// could cause the send half to block. It is recommended to keep the borrow |
355 |
| - /// as short lived as possible. Additionally, if you are running in an |
356 |
| - /// environment that allows `!Send` futures, you must ensure that the |
357 |
| - /// returned `Ref` type is never held alive across an `.await` point. |
| 354 | + /// Outstanding borrows hold a read lock on the inner value. This means that |
| 355 | + /// long-lived borrows could cause the producer half to block. It is recommended |
| 356 | + /// to keep the borrow as short-lived as possible. Additionally, if you are |
| 357 | + /// running in an environment that allows `!Send` futures, you must ensure that |
| 358 | + /// the returned `Ref` type is never held alive across an `.await` point, |
| 359 | + /// otherwise, it can lead to a deadlock. |
358 | 360 | ///
|
359 | 361 | /// The priority policy of the lock is dependent on the underlying lock
|
360 | 362 | /// implementation, and this type does not guarantee that any particular policy
|
@@ -401,11 +403,12 @@ impl<T> Receiver<T> {
|
401 | 403 | /// will not return immediately until the [`Sender`] has modified the shared
|
402 | 404 | /// value again.
|
403 | 405 | ///
|
404 |
| - /// Outstanding borrows hold a read lock. This means that long lived borrows |
405 |
| - /// could cause the send half to block. It is recommended to keep the borrow |
406 |
| - /// as short lived as possible. Additionally, if you are running in an |
407 |
| - /// environment that allows `!Send` futures, you must ensure that the |
408 |
| - /// returned `Ref` type is never held alive across an `.await` point. |
| 406 | + /// Outstanding borrows hold a read lock on the inner value. This means that |
| 407 | + /// long-lived borrows could cause the producer half to block. It is recommended |
| 408 | + /// to keep the borrow as short-lived as possible. Additionally, if you are |
| 409 | + /// running in an environment that allows `!Send` futures, you must ensure that |
| 410 | + /// the returned `Ref` type is never held alive across an `.await` point, |
| 411 | + /// otherwise, it can lead to a deadlock. |
409 | 412 | ///
|
410 | 413 | /// The priority policy of the lock is dependent on the underlying lock
|
411 | 414 | /// implementation, and this type does not guarantee that any particular policy
|
@@ -794,9 +797,12 @@ impl<T> Sender<T> {
|
794 | 797 |
|
795 | 798 | /// Returns a reference to the most recently sent value
|
796 | 799 | ///
|
797 |
| - /// Outstanding borrows hold a read lock. This means that long lived borrows |
798 |
| - /// could cause the send half to block. It is recommended to keep the borrow |
799 |
| - /// as short lived as possible. |
| 800 | + /// Outstanding borrows hold a read lock on the inner value. This means that |
| 801 | + /// long-lived borrows could cause the producer half to block. It is recommended |
| 802 | + /// to keep the borrow as short-lived as possible. Additionally, if you are |
| 803 | + /// running in an environment that allows `!Send` futures, you must ensure that |
| 804 | + /// the returned `Ref` type is never held alive across an `.await` point, |
| 805 | + /// otherwise, it can lead to a deadlock. |
800 | 806 | ///
|
801 | 807 | /// # Examples
|
802 | 808 | ///
|
|
0 commit comments