pub trait Mutex {
type T;
// Required method
fn lock<R>(&mut self, f: impl FnOnce(&mut Self::T) -> R) -> R;
}
Expand description
Memory safe access to shared resources
In RTIC, locks are implemented as critical sections that prevent other tasks from starting. These critical sections are implemented by temporarily increasing the dynamic priority of the current context. Entering and leaving these critical sections is always done in bounded constant time (a few instructions in bare metal contexts).
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.