pub struct RawMutex(/* private fields */);
Expand description
A mutex that prevents code from running in both an IRQ and normal code at the same time.
Note that this does not support blocking like a typical mutex, and instead mainly exists for memory safety reasons.
Implementations§
source§impl RawMutex
impl RawMutex
sourcepub fn lock(&self) -> RawMutexGuard<'_>
pub fn lock(&self) -> RawMutexGuard<'_>
Returns a guard for this lock, or panics if there is another lock active.
sourcepub fn try_lock(&self) -> Option<RawMutexGuard<'_>>
pub fn try_lock(&self) -> Option<RawMutexGuard<'_>>
Returns a guard for this lock, or None
if there is another lock active.