Struct qutex::QrwLock [] [src]

pub struct QrwLock<T> { /* fields omitted */ }

A lock-free queue-backed read/write data lock.

Methods

impl<T> QrwLock<T>
[src]

Creates and returns a new QrwLock.

Returns a new FutureReadGuard which can be used as a future and will resolve into a ReadGuard.

Returns a new FutureWriteGuard which can be used as a future and will resolve into a WriteGuard.

Pushes a lock request onto the queue.

Returns a mutable reference to the inner Vec if there are currently no other copies of this QrwLock.

Since this call borrows the inner lock mutably, no actual locking needs to take place---the mutable borrow statically guarantees no locks exist.

Returns a reference to the inner value.

This is frought with potential peril.

Returns a mutable reference to the inner value.

Drinking water from the tap in 1850's London would be safer.

Pops the next lock request in the queue if possible.

If this lock is unlocked, read or write-locks this lock and unparks the next requester task in the queue.

If this lock is write-locked, this function does nothing.

If this lock is read-locked and the next request or consecutive requests in the queue are read requests, those requests will be fulfilled, unparking their respective tasks and incrementing the read-lock count appropriately.

Decreases the reader count by one and unparks the next requester task in the queue if possible.

Unlocks this lock and unparks the next requester task in the queue if possible.

Trait Implementations

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

Performs the conversion.

impl<T> Clone for QrwLock<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more