Struct lrs::sync::Mutex

A mutex protecting some data.

Syntax

struct Mutex<T> {
    /* private fields */
}

Static methods

NameDescription
new

Creates a new mutex.

Methods

ReceiverNameDescription
&selfas_lock

Returns the underlying lock of this mutex.

&mut selfdata

Provides mutable access to the protected data without locking the lock.

&selfexisting_lock

Turns a lock-guard of the underlying lock into a mutex-guard.

&selflock

Locks the mutex by sleeping until the mutex is unlocked if it's currently locked.

&selftry_lock

Tries to lock the mutex if it's currently unlocked.

Trait implementations

NameDescription
Send

Objects whose ownership can be moved from one thread to another.

Sync

Objects that allow immutable access from threads other than their owning thread.