[−][src]Trait embedded_hal::mutex::RwMutex
A read-write (mutable) mutex.
This mutex type is similar to the Mutex from std
. When you lock it, you
get access to a mutable reference.
This trait can automatically be implemented for RoMutex<RefCell<T>>
by using
impl<T> mutex::default::RefCellRw for MyMutex<T> { }
Associated Types
Required methods
fn lock_mut<R>(&self, f: impl FnOnce(&mut T) -> R) -> Result<R, Self::Error>
[−]
Lock the mutex for the duration of a closure
lock_mut
will call a closure with a mutable reference to the unlocked
mutex's value.