Trait embedded_svc::mutex::Mutex[][src]

pub trait Mutex {
    type Data;
    fn with_lock<R>(&self, f: impl FnOnce(&mut Self::Data) -> R) -> R;
}
Expand description

A simple Mutex trait for no_std environments Unlike mutex-trait this one does NOT take &mut self in its locking method.

This makes it compatible with core::sync::Arc, i.e. it can be passed around to threads freely.

Associated Types

Data protected by the mutex.

Required methods

Creates a critical section and grants temporary access to the protected data.

Implementations on Foreign Types

Implementors