Struct std::sys_common::mutex::MovableMutex[][src]

pub struct MovableMutex(Box<Mutex>);
Expand description

An OS-based mutual exclusion lock.

This mutex does not have a const constructor, cleans up its resources in its Drop implementation, may safely be moved (when not borrowed), and does not cause UB when used reentrantly.

This mutex does not implement poisoning.

This is either a wrapper around Box<imp::Mutex> or imp::Mutex, depending on the platform. It is boxed on platforms where imp::Mutex may not be moved.

Tuple Fields

0: Box<Mutex>

Implementations

Creates a new mutex.

Locks the mutex blocking the current thread until it is available.

Attempts to lock the mutex without blocking, returning whether it was successfully acquired or not.

Unlocks the mutex.

Behavior is undefined if the current thread does not actually hold the mutex.

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.