mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
sync: add link to PollSemaphore (#3456)
This commit is contained in:
@@ -13,6 +13,11 @@ use std::sync::Arc;
|
|||||||
/// function immediately returns a permit. However, if no remaining permits are
|
/// function immediately returns a permit. However, if no remaining permits are
|
||||||
/// available, `acquire` (asynchronously) waits until an outstanding permit is
|
/// available, `acquire` (asynchronously) waits until an outstanding permit is
|
||||||
/// dropped. At this point, the freed permit is assigned to the caller.
|
/// 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)]
|
#[derive(Debug)]
|
||||||
pub struct Semaphore {
|
pub struct Semaphore {
|
||||||
/// The low level semaphore
|
/// The low level semaphore
|
||||||
|
|||||||
Reference in New Issue
Block a user