pub struct Mutex<T> { /* private fields */ }Expand description
Data shared with interrupt code, reachable only inside a critical section.
For mutation, wrap the value in a [core::cell::Cell] or
[core::cell::RefCell].
Implementations§
Source§impl<T> Mutex<T>
impl<T> Mutex<T>
Sourcepub fn borrow<'cs>(&'cs self, _cs: CriticalSection<'cs>) -> &'cs T
pub fn borrow<'cs>(&'cs self, _cs: CriticalSection<'cs>) -> &'cs T
Borrow the value for as long as the critical section lasts.
Sourcepub fn get_mut(&mut self) -> &mut T
pub fn get_mut(&mut self) -> &mut T
Mutable access through exclusive ownership, no section needed.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unwrap the value.