Struct itron_asp3::mutex::Mutex[][src]

pub struct Mutex(_);
This is supported on crate features unstable and dcre only.
Expand description

An owned mutex.

Deletes the mutex automatically when dropped. The destructor will panic if the deletion fails.

Implementations

acre_mtx: Create a builder for Mutex.

Examples
use itron::mutex::Mutex;
let mutex = Mutex::build()
    .finish()
    .expect("failed to create a mutex");

mutex.as_ref().lock()
   .expect("failed to perform a lock operation");
mutex.as_ref().unlock()
   .expect("failed to perform a unlock operation");
use itron::mutex::{Mutex, PriorityProtection};
let mutex = Mutex::build()
    .priority_protection(PriorityProtection::Ceiling { priority: 4 })
    .finish()
    .expect("failed to create a priority-ceiling mutex");

mutex.as_ref().lock()
   .expect("failed to perform a lock operation");
mutex.as_ref().unlock()
   .expect("failed to perform a unlock operation");

Construct a Mutex from a raw object ID.

Safety

See Object ID Wrappers.

Consume and “leak” self, returning a reference MutexRef<'a>.

Get the raw object ID.

Get the raw object ID as abi::NonNullID.

Borrow Mutex as MutexRef.

Use this to perform operations on mutexes because most of the methods are implemented on MutexRef but not Mutex.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.