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
Auto Trait Implementations
impl RefUnwindSafe for Mutex
impl Send for Mutex
impl Sync for Mutex
impl Unpin for Mutex
impl UnwindSafe for Mutex
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
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