summaryrefslogtreecommitdiffstats
path: root/tokio/src/sync/mpsc/chan.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio/src/sync/mpsc/chan.rs')
-rw-r--r--tokio/src/sync/mpsc/chan.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tokio/src/sync/mpsc/chan.rs b/tokio/src/sync/mpsc/chan.rs
index e7b951ed..6fedb5c5 100644
--- a/tokio/src/sync/mpsc/chan.rs
+++ b/tokio/src/sync/mpsc/chan.rs
@@ -143,6 +143,10 @@ impl<T, S> Tx<T, S> {
}
impl<T, S: Semaphore> Tx<T, S> {
+ pub(crate) fn is_closed(&self) -> bool {
+ self.inner.semaphore.is_closed()
+ }
+
pub(crate) async fn closed(&mut self) {
use std::future::Future;
use std::pin::Pin;