[][src]Struct sgx_tstd::sync::SgxReentrantMutex

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

A re-entrant mutual exclusion

This mutex will block other threads waiting for the lock to become available. The thread which has already locked the mutex can lock it multiple times without blocking, preventing a common source of deadlocks.

Methods

impl<T> SgxReentrantMutex<T>[src]

pub fn new(t: T) -> SgxReentrantMutex<T>[src]

Creates a new reentrant mutex in an unlocked state.

pub fn lock(&self) -> LockResult<SgxReentrantMutexGuard<T>>[src]

Acquires a mutex, blocking the current thread until it is able to do so.

This function will block the caller until it is available to acquire the mutex. Upon returning, the thread is the only thread with the mutex held. When the thread calling this method already holds the lock, the call shall succeed without blocking.

Errors

If another user of this mutex panicked while holding the mutex, then this call will return failure if the mutex would otherwise be acquired.

pub fn try_lock(&self) -> TryLockResult<SgxReentrantMutexGuard<T>>[src]

Attempts to acquire this lock.

If the lock could not be acquired at this time, then Err is returned. Otherwise, an RAII guard is returned.

This function does not block.

Errors

If another user of this mutex panicked while holding the mutex, then this call will return failure if the mutex would otherwise be acquired.

Trait Implementations

impl<T: Debug + 'static> Debug for SgxReentrantMutex<T>[src]

impl<T> Drop for SgxReentrantMutex<T>[src]

impl<T> RefUnwindSafe for SgxReentrantMutex<T>[src]

impl<T: Send> Send for SgxReentrantMutex<T>[src]

impl<T: Send> Sync for SgxReentrantMutex<T>[src]

impl<T> UnwindSafe for SgxReentrantMutex<T>[src]

Auto Trait Implementations

impl<T> Unpin for SgxReentrantMutex<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.