pub struct Mutex<T> {
lock: AtomicBool,
cell: UnsafeCell<T>,
phantom: PhantomData<T>,
}
Expand description
Fields§
§lock: AtomicBool
§cell: UnsafeCell<T>
§phantom: PhantomData<T>
Implementations§
source§impl<T> Mutex<T>
impl<T> Mutex<T>
sourcepub fn lock(&self) -> MutexGuard<'_, T>
pub fn lock(&self) -> MutexGuard<'_, T>
Acquires a lock on the Mutex
and returns a MutexGuard that provides exclusive access to
the shared resource.