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§
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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: 112 bytes