pub trait RawMutex {
    const INIT: Self;

    // Required methods
    fn new() -> Self;
    unsafe fn lock(&self);
    unsafe fn unlock(&self);
}
Expand description

A raw Mutex trait for no_std environments. Prevents the introduction of dependency on STD for the utils module and its sub-modules. NOTE: Users are strongly advised to just depend on STD and use the STD Mutex in their code.

Required Associated Constants§

source

const INIT: Self

Required Methods§

source

fn new() -> Self

source

unsafe fn lock(&self)

Safety
  • This method should NOT be called while the mutex is being waited on in a condvar
source

unsafe fn unlock(&self)

Safety
  • This method should NOT be called while the mutex is being waited on in a condvar
  • This method should only be called by the entity currently holding the mutex (i.e. the entity which successfully called lock earlier)

Object Safety§

This trait is not object safe.

Implementors§

source§

impl RawMutex for StdRawMutex

source§

const INIT: Self = _