Struct crs_bind::rtos::Mutex[][src]

pub struct Mutex<T: ?Sized> { /* fields omitted */ }

Represents an object which is protected by a FreeRTOS recursive mutex.

Implementations

impl<T> Mutex<T>[src]

Provides a constant-period looping construct.

pub fn new(data: T) -> Self[src]

Creates a new mutex which wraps the given object. Panics on failure; see Mutex::try_new().

pub fn try_new(data: T) -> Result<Self, Error>[src]

Creates a new mutex which wraps the given object.

impl<T: ?Sized> Mutex<T>[src]

pub fn lock(&self) -> MutexGuard<'_, T>[src]

Obtains a MutexGuard giving access to the object protected by the mutex. Blocks until access can be obtained. Panics on failure; see Mutex::try_lock().

Behaviour

This function is blocking; it does not return until the the mutex is taken by the task, and allows other tasks to run in the meantime. Further, the task which currently holds the mutex actually inherits the current task’s priority, if it is higher; this prevents a high-priority task from being slowed down by waiting for a resource held by a low-priority task. See this documentation from FreeRTOS for details.

pub fn try_lock(&self) -> Result<MutexGuard<'_, T>, Error>[src]

Obtains a MutexGuard giving access to the object protected by the mutex. Blocks until access can be obtained; see Mutex::lock() for a more thorough behavioural description.

pub fn poll(&self) -> Option<MutexGuard<'_, T>>[src]

Obtains a MutexGuard giving access to the object protected by the mutex, if it is available immediately. Does not block.

Trait Implementations

impl<T: ?Sized + Debug> Debug for Mutex<T>[src]

impl<T: ?Sized + Default> Default for Mutex<T>[src]

impl<T: ?Sized> Drop for Mutex<T>[src]

impl<T> From<T> for Mutex<T>[src]

impl<T: ?Sized + Send> Send for Mutex<T>[src]

impl<T: ?Sized + Sync> Sync for Mutex<T>[src]

Auto Trait Implementations

impl<T: ?Sized> Unpin for Mutex<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.