diff options
author | Oleg Nosov <olegnosov1@gmail.com> | 2020-01-24 20:31:13 +0300 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2020-01-24 09:31:13 -0800 |
commit | f9ddb93604a830d106475bd4c4cae436fafcc0da (patch) | |
tree | 6f200680e68b290794ef0512dcb031ef6d81c5ea /tokio/src/sync/semaphore.rs | |
parent | a70f7203a46d471345128832987017612d8e4585 (diff) |
docs: use third form in API docs (#2027)
Diffstat (limited to 'tokio/src/sync/semaphore.rs')
-rw-r--r-- | tokio/src/sync/semaphore.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tokio/src/sync/semaphore.rs b/tokio/src/sync/semaphore.rs index 13d5cfb2..7721e01f 100644 --- a/tokio/src/sync/semaphore.rs +++ b/tokio/src/sync/semaphore.rs @@ -49,12 +49,12 @@ impl Semaphore { self.ll_sem.available_permits() } - /// Add `n` new permits to the semaphore. + /// Adds `n` new permits to the semaphore. pub fn add_permits(&self, n: usize) { self.ll_sem.add_permits(n); } - /// Acquire permit from the semaphore + /// Acquires permit from the semaphore pub async fn acquire(&self) -> SemaphorePermit<'_> { let mut permit = SemaphorePermit { sem: &self, @@ -66,7 +66,7 @@ impl Semaphore { permit } - /// Try to acquire a permit form the semaphore + /// Tries to acquire a permit form the semaphore pub fn try_acquire(&self) -> Result<SemaphorePermit<'_>, TryAcquireError> { let mut ll_permit = ll::Permit::new(); match ll_permit.try_acquire(1, &self.ll_sem) { @@ -80,7 +80,7 @@ impl Semaphore { } impl<'a> SemaphorePermit<'a> { - /// Forget the permit **without** releasing it back to the semaphore. + /// Forgets the permit **without** releasing it back to the semaphore. /// This can be used to reduce the amount of permits available from a /// semaphore. pub fn forget(mut self) { |