pub struct Semaphore { /* private fields */ }
Semaphore implementation
Create a new semaphore
Wait on semaphore (P operation)
Try to wait on semaphore without blocking
Signal semaphore (V operation).
Returns Err if signalling would exceed the maximum count, indicating a caller bug (more signals than waits). This avoids a kernel panic inside what may be a lock-holding context.
Err
Get current count
TypeId
self
Returns the argument unchanged.
Calls U::from(self).
U::from(self)
That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.
[From]<T> for U