[−][src]Trait embedded_hal::mutex::RoMutex
A read-only (immutable) mutex.
This means, the value it shares is immutable, but only a single context may have exclusive access.
RwMutex
es can implement this trait automatically using
impl<T> mutex::default::DefaultRo for MyMutex<T> { }
Associated Types
Required methods
fn lock<R>(&self, f: impl FnOnce(&T) -> R) -> Result<R, Self::Error>
[−]
Lock the mutex for the duration of a closure
lock
will call a closure with an immutable reference to the unlocked
mutex's value.