Struct semka::Sem

source · []
pub struct Sem { /* private fields */ }
Expand description

POSIX implementation of Semaphore

Implementations

Creates new uninit instance.

It is UB to use it until init is called.

Initializes semaphore with provided init as initial value.

Returns true on success.

Returns false if semaphore is already initialized or initialization failed.

Creates new instance, initializing it with init

Decrements self, returning immediately if it was signaled.

Otherwise awaits for signal.

Attempts to decrement self, returning whether self was signaled or not.

Returns true if self was signaled.

Returns false otherwise.

Attempts to decrement self within provided time, returning whether self was signaled or not.

Returns true if self was signaled within specified timeout

Returns false otherwise

Increments self, waking any awaiting thread as result.

Performs deinitialization.

Using Sem after close is undefined behaviour, unless init is called

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.