pub struct Semaphore { /* private fields */ }
Expand description
A counting or binary semaphore
Implementations§
Source§impl Semaphore
impl Semaphore
Sourcepub fn new_binary() -> Result<Semaphore, FreeRtosError>
pub fn new_binary() -> Result<Semaphore, FreeRtosError>
Create a new binary semaphore
Sourcepub fn new_counting(max: u32, initial: u32) -> Result<Semaphore, FreeRtosError>
pub fn new_counting(max: u32, initial: u32) -> Result<Semaphore, FreeRtosError>
Create a new counting semaphore
Sourcepub fn lock<D: DurationTicks>(
&self,
max_wait: D,
) -> Result<SemaphoreGuard, FreeRtosError>
pub fn lock<D: DurationTicks>( &self, max_wait: D, ) -> Result<SemaphoreGuard, FreeRtosError>
Lock this semaphore in a RAII fashion
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Semaphore
impl RefUnwindSafe for Semaphore
impl Unpin for Semaphore
impl UnwindSafe for Semaphore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more