Struct tokio_sync::semaphore::Semaphore [−][src]
pub struct Semaphore { /* fields omitted */ }Futures-aware semaphore.
Implementations
impl Semaphore[src]
impl Semaphore[src]pub fn new(permits: usize) -> Semaphore[src]
pub fn available_permits(&self) -> usize[src]
Returns the current number of available permits
pub fn close(&self)[src]
Close the semaphore. This prevents the semaphore from issuing new permits and notifies all pending waiters.
pub fn add_permits(&self, n: usize)[src]
Add n new permits to the semaphore.