From 29bd5fad5ca0100b4b72bda350b0f7bf37e86127 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Thu, 21 Jan 2021 15:20:55 +0100 Subject: [PATCH] sync: add link to PollSemaphore (#3456) --- tokio/src/sync/semaphore.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tokio/src/sync/semaphore.rs b/tokio/src/sync/semaphore.rs index 5555bdf9324..bff5de98cda 100644 --- a/tokio/src/sync/semaphore.rs +++ b/tokio/src/sync/semaphore.rs @@ -13,6 +13,11 @@ use std::sync::Arc; /// function immediately returns a permit. However, if no remaining permits are /// available, `acquire` (asynchronously) waits until an outstanding permit is /// dropped. At this point, the freed permit is assigned to the caller. +/// +/// To use the `Semaphore` in a poll function, you can use the [`PollSemaphore`] +/// utility. +/// +/// [`PollSemaphore`]: https://docs.rs/tokio-util/0.6/tokio_util/sync/struct.PollSemaphore.html #[derive(Debug)] pub struct Semaphore { /// The low level semaphore