Module swc_common::sync [−][src]
This module defines types which are thread safe if cfg!(feature = "concurrent")
is true.
Lrc
is an alias of either Rc or Arc.
Lock
is a mutex.
It internally uses parking_lot::Mutex
if cfg!(parallel_queries) is true,
RefCell
otherwise.
RwLock
is a read-write lock.
It internally uses parking_lot::RwLock
if cfg!(parallel_queries) is true,
RefCell
otherwise.
LockCell
is a thread safe version of Cell
, with set
and get
operations. It can never deadlock. It uses Cell
when
cfg!(parallel_queries) is false, otherwise it is a Lock
.
MTLock
is a mutex which disappears if cfg!(parallel_queries) is false.
MTRef
is a immutable reference if cfg!(parallel_queries), and an mutable
reference otherwise.
rustc_erase_owner!
erases a OwningRef owner into Erased or Erased + Send +
Sync depending on the value of cfg!(parallel_queries).
Structs
Lazy | A value which is initialized on the first access. |
Lock | |
LockCell | |
LockGuard | A wrapper type for a mutably borrowed value from a |
Lrc | A single-threaded reference-counting pointer. 'Rc' stands for 'Reference Counted'. |
MappedLockGuard | A wrapper type for a mutably borrowed value from a |
MappedReadGuard | Wraps a borrowed reference to a value in a |
MappedWriteGuard | A wrapper type for a mutably borrowed value from a |
OnceCell | A cell which can be written to only once. It is not thread safe. |
ReadGuard | Wraps a borrowed reference to a value in a |
RwLock | |
Weak |
|
WriteGuard | A wrapper type for a mutably borrowed value from a |
Traits
HashMapExt | |
Send | Dummy trait because swc_common is in single thread mode. |
Sync | Dummy trait because swc_common is in single thread mode. |