Struct qutex::Qutex [−][src]
pub struct Qutex<T> { /* fields omitted */ }
A lock-free-queue-backed exclusive data lock.
Methods
impl<T> Qutex<T>
[src]
impl<T> Qutex<T>
pub fn new(val: T) -> Qutex<T>
[src]
pub fn new(val: T) -> Qutex<T>
Creates and returns a new Qutex
.
pub fn lock(self) -> FutureGuard<T>
[src]
pub fn lock(self) -> FutureGuard<T>
Returns a new FutureGuard
which can be used as a future and will
resolve into a Guard
.
pub unsafe fn push_request(&self, req: Request)
[src]
pub unsafe fn push_request(&self, req: Request)
Pushes a lock request onto the queue.
pub fn get_mut(&mut self) -> Option<&mut T>
[src]
pub fn get_mut(&mut self) -> Option<&mut T>
Returns a mutable reference to the inner Vec
if there are currently
no other copies of this Qutex
.
Since this call borrows the inner lock mutably, no actual locking needs to take place---the mutable borrow statically guarantees no locks exist.
pub fn as_ptr(&self) -> *const T
[src]
pub fn as_ptr(&self) -> *const T
Returns a reference to the inner value.
pub fn as_mut_ptr(&self) -> *mut T
[src]
pub fn as_mut_ptr(&self) -> *mut T
Returns a mutable reference to the inner value.
pub unsafe fn process_queue(&self)
[src]
pub unsafe fn process_queue(&self)
Pops the next lock request in the queue if this (the caller's) lock is unlocked.
pub unsafe fn direct_unlock(&self)
[src]
pub unsafe fn direct_unlock(&self)
Unlocks this (the caller's) lock and wakes up the next task in the queue.
Trait Implementations
impl<T: Debug> Debug for Qutex<T>
[src]
impl<T: Debug> Debug for Qutex<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> From<T> for Qutex<T>
[src]
impl<T> From<T> for Qutex<T>
impl<T> Clone for Qutex<T>
[src]
impl<T> Clone for Qutex<T>