diff options
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) { |