pub struct MutexImpl<T: ?Sized, M> { /* private fields */ }
Expand description
Mutual exclusion access to a contained value. Can be recursive - the current owner of a lock can re-lock it.
Implementations§
Source§impl<T> MutexImpl<T, MutexNormal>
impl<T> MutexImpl<T, MutexNormal>
Sourcepub fn new(t: T) -> Result<Self, FreeRtosError>
pub fn new(t: T) -> Result<Self, FreeRtosError>
Create a new mutex with the given inner value
Source§impl<T> MutexImpl<T, MutexRecursive>
impl<T> MutexImpl<T, MutexRecursive>
Sourcepub fn new(t: T) -> Result<Self, FreeRtosError>
pub fn new(t: T) -> Result<Self, FreeRtosError>
Create a new recursive mutex with the given inner value
Source§impl<T, M> MutexImpl<T, M>where
M: MutexInnerImpl,
impl<T, M> MutexImpl<T, M>where
M: MutexInnerImpl,
Sourcepub fn lock<D: DurationTicks>(
&self,
max_wait: D,
) -> Result<MutexGuard<'_, T, M>, FreeRtosError>
pub fn lock<D: DurationTicks>( &self, max_wait: D, ) -> Result<MutexGuard<'_, T, M>, FreeRtosError>
Try to obtain a lock and mutable access to our inner value
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the mutex and return its inner value
Trait Implementations§
impl<T: Sync + Send, M> Send for MutexImpl<T, M>
impl<T: Sync + Send, M> Sync for MutexImpl<T, M>
Auto Trait Implementations§
impl<T, M> !Freeze for MutexImpl<T, M>
impl<T, M> !RefUnwindSafe for MutexImpl<T, M>
impl<T, M> Unpin for MutexImpl<T, M>
impl<T, M> UnwindSafe for MutexImpl<T, M>
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