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");
Consume and “leak” self
, returning a reference MutexRef<'a>
.
Get the raw object ID as abi::NonNullID
.