Trait concurrency_traits::semaphore::TimeoutSemaphore[][src]

pub unsafe trait TimeoutSemaphore: TrySemaphore {
    fn wait_timeout(&self, timeout: Duration) -> bool;
}
Expand description

A generic semaphore that can timeout.

Safety

This trait is marked as unsafe to allow for safe code to rely on the standard semaphore contract. Default implementations should initialize the count at 0.

Required methods

fn wait_timeout(&self, timeout: Duration) -> bool[src]

Blocks until can decrement or times out. Then returns true if decremented or false if timed out.

Implementors

impl<C, CS> TimeoutSemaphore for ParkSemaphore<C, CS> where
    C: Zero + One + AddAssign + SubAssign,
    CS: ThreadTimeoutParker + TimeFunctions + ThreadFunctions
[src]

fn wait_timeout(&self, timeout: Duration) -> bool[src]