Struct miri::concurrency::sync::Mutex

source ·
struct Mutex {
    owner: Option<ThreadId>,
    lock_count: usize,
    queue: VecDeque<ThreadId>,
    data_race: VClock,
}
Expand description

The mutex state.

Fields

owner: Option<ThreadId>

The thread that currently owns the lock.

lock_count: usize

How many times the mutex was locked by the owner.

queue: VecDeque<ThreadId>

The queue of threads waiting for this mutex.

data_race: VClock

Data race handle, this tracks the happens-before relationship between each mutex access. It is released to during unlock and acquired from during locking, and therefore stores the clock of the last thread to release this mutex.

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 80 bytes