Skip to main content

Module lock

Module lock 

Source
Expand description

This module implements a lock which only uses synchronization if might_be_dyn_thread_safe is true. It implements DynSend and DynSync instead of the typical Send and Sync traits.

Re-exportsยง

use std::fmt; ๐Ÿ”’
use std::hint; ๐Ÿ”’
use std::cell::Cell; ๐Ÿ”’
use std::cell::UnsafeCell; ๐Ÿ”’
use std::marker::PhantomData; ๐Ÿ”’
use std::mem::ManuallyDrop; ๐Ÿ”’
use std::ops::Deref; ๐Ÿ”’
use std::ops::DerefMut; ๐Ÿ”’
use parking_lot::RawMutex; ๐Ÿ”’
use parking_lot::lock_api::RawMutex as _; ๐Ÿ”’
use crate::sync::DynSend; ๐Ÿ”’
use crate::sync::DynSync; ๐Ÿ”’
use crate::sync::mode; ๐Ÿ”’

Structsยง

Lock
A lock which only uses synchronization if might_be_dyn_thread_safe is true. It implements DynSend and DynSync instead of the typical Send and Sync.
LockGuard
A guard holding mutable access to a Lock which is in a locked state.

Enumsยง

Mode

Constantsยง

LOCKED ๐Ÿ”’
The value representing a locked state for the Cell.

Unionsยง

ModeUnion ๐Ÿ”’