warn of possible race condition in channel is_disconnected doc

This commit is contained in:
LevitatingBusinessMan (Rein Fernhout)
2026-02-28 19:52:50 +01:00
parent 7adb9bac0c
commit feef7b4eaf
2 changed files with 16 additions and 0 deletions

View File

@@ -626,6 +626,10 @@ impl<T> Sender<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
///
/// ```
@@ -1375,6 +1379,10 @@ impl<T> Receiver<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
///
/// ```

View File

@@ -610,6 +610,10 @@ impl<T> Sender<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 @@ impl<T> Receiver<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
///
/// ```