mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 06:43:20 +03:00
warn of possible race condition in channel is_disconnected doc
This commit is contained in:
parent
7adb9bac0c
commit
feef7b4eaf
@@ -626,6 +626,10 @@ pub fn same_channel(&self, other: &Sender<T>) -> bool {
|
||||
|
||||
/// Returns `true` if the channel is disconnected.
|
||||
///
|
||||
/// Note that a return value of `false` does not guarantee the channel will
|
||||
/// remain connected. The channel may be disconnected immediately after this method
|
||||
/// returns, so a subsequent [`Sender::send`] may still fail with [`SendError`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
@@ -1375,6 +1379,10 @@ pub fn iter(&self) -> Iter<'_, T> {
|
||||
|
||||
/// Returns `true` if the channel is disconnected.
|
||||
///
|
||||
/// Note that a return value of `false` does not guarantee the channel will
|
||||
/// remain connected. The channel may be disconnected immediately after this method
|
||||
/// returns, so a subsequent [`Receiver::recv`] may still fail with [`RecvError`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
||||
@@ -610,6 +610,10 @@ pub fn send(&self, t: T) -> Result<(), SendError<T>> {
|
||||
|
||||
/// Returns `true` if the channel is disconnected.
|
||||
///
|
||||
/// Note that a return value of `false` does not guarantee the channel will
|
||||
/// remain connected. The channel may be disconnected immediately after this method
|
||||
/// returns, so a subsequent [`Sender::send`] may still fail with [`SendError`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
@@ -1060,6 +1064,10 @@ pub fn try_iter(&self) -> TryIter<'_, T> {
|
||||
|
||||
/// Returns `true` if the channel is disconnected.
|
||||
///
|
||||
/// Note that a return value of `false` does not guarantee the channel will
|
||||
/// remain connected. The channel may be disconnected immediately after this method
|
||||
/// returns, so a subsequent [`Receiver::recv`] may still fail with [`RecvError`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
||||
Reference in New Issue
Block a user