Struct priomutex::reservable::Mutex [] [src]

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

A mutex with no blocking support, but the ability to reserve the lock for another thread.

Methods

impl<T> Mutex<T>
[src]

[src]

Creates a new mutex in an unlocked state ready for use.

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

[src]

Attempts to acquire this lock. If the lock is free, or has been assigned to this thread by the last holder, then the lock will be acquired.

If the lock could not be acquired at this time, then None is returned. Otherwise, an RAII guard is returned. The lock will be unlocked when the guard is dropped.

This function does not block.

[src]

Consumes this mutex, returning the underlying data.

[src]

Returns a mutable reference to the underlying data.

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

Trait Implementations

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

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