Struct std::sys_common::remutex::ReentrantMutex[][src]

pub struct ReentrantMutex<T> {
    inner: ReentrantMutex,
    data: T,
    _pinned: PhantomPinned,
}
Expand description

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.

Fields

inner: ReentrantMutexdata: T_pinned: PhantomPinned

Implementations

Creates a new reentrant mutex in an unlocked state.

Unsafety

This function is unsafe because it is required that init is called once this mutex is in its final resting place, and only then are the lock/unlock methods safe.

Initializes this mutex so it’s ready for use.

Unsafety

Unsafe to call more than once, and must be called after this will no longer move in memory.

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.

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

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.