aboutsummaryrefslogtreecommitdiff
path: root/src/sync/mpsc/bounded.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync/mpsc/bounded.rs')
-rw-r--r--src/sync/mpsc/bounded.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sync/mpsc/bounded.rs b/src/sync/mpsc/bounded.rs
index 8babdc7..e870ae5 100644
--- a/src/sync/mpsc/bounded.rs
+++ b/src/sync/mpsc/bounded.rs
@@ -18,7 +18,7 @@ use std::task::{Context, Poll};
/// To convert the `Sender` into a `Sink` or use it in a poll function, you can
/// use the [`PollSender`] utility.
///
-/// [`PollSender`]: https://docs.rs/tokio-util/0.6/tokio_util/sync/struct.PollSender.html
+/// [`PollSender`]: https://docs.rs/tokio-util/latest/tokio_util/sync/struct.PollSender.html
pub struct Sender<T> {
chan: chan::Tx<T, Semaphore>,
}
@@ -326,6 +326,7 @@ impl<T> Receiver<T> {
/// ```
#[track_caller]
#[cfg(feature = "sync")]
+ #[cfg_attr(docsrs, doc(alias = "recv_blocking"))]
pub fn blocking_recv(&mut self) -> Option<T> {
crate::future::block_on(self.recv())
}
@@ -696,6 +697,7 @@ impl<T> Sender<T> {
/// ```
#[track_caller]
#[cfg(feature = "sync")]
+ #[cfg_attr(docsrs, doc(alias = "send_blocking"))]
pub fn blocking_send(&self, value: T) -> Result<(), SendError<T>> {
crate::future::block_on(self.send(value))
}
@@ -859,6 +861,8 @@ impl<T> Sender<T> {
}
async fn reserve_inner(&self) -> Result<(), SendError<()>> {
+ crate::trace::async_trace_leaf().await;
+
match self.chan.semaphore().semaphore.acquire(1).await {
Ok(_) => Ok(()),
Err(_) => Err(SendError(())),