Module sync

Source
Expand description

Useful synchronization primitives.

Modulesยง

guard ๐Ÿ”’
mutex ๐Ÿ”’
non_null
This module provides a trait and some auxiliary types to help abstract and work with non-null pointers.
rcu ๐Ÿ”’
Read-copy update (RCU).
rwarc ๐Ÿ”’
rwlock ๐Ÿ”’
rwmutex ๐Ÿ”’
spin ๐Ÿ”’
wait ๐Ÿ”’

Structsยง

Mutex
A mutex with waitqueue.
Rcu
A Read-Copy Update (RCU) cell for sharing a pointer between threads.
RcuDrop
A wrapper to delay calling destructor of T after the RCU grace period.
RcuOption
A Read-Copy Update (RCU) cell for sharing a nullable pointer.
RcuOptionReadGuard
A guard that allows access to the pointed data protected by a RcuOption.
RcuReadGuard
A guard that allows access to the pointed data protected by a Rcu.
RoArc
A reference-counting pointer with read-only capabilities.
RwArc
A reference-counting pointer with read-write capabilities.
RwLock
Spin-based Read-write Lock
RwMutex
A mutex that provides data access to either one writer or many readers.
SpinLock
A spin lock.
WaitQueue
A wait queue.
Waiter
A waiter that can put the current thread to sleep until it is woken up by the associated Waker.
Waker
A waker that can wake up the associated Waiter.

Enumsยง

LocalIrqDisabled
A guardian that disables IRQs while holding a lock.
PreemptDisabled
A guardian that disables preemption while holding a lock.
WriteIrqDisabled
A guardian that disables IRQs while holding a write lock.

Traitsยง

GuardTransfer
The Guard can be transferred atomically.
SpinGuardian
A guardian that denotes the guard behavior for holding a spin-based lock.

Functionsยง

init ๐Ÿ”’

Type Aliasesยง

ArcMutexGuard
An guard that provides exclusive access to the data protected by a Arc<Mutex>.
ArcRwLockReadGuard
A guard that provides shared read access to the data protected by a Arc<RwLock>.
ArcRwLockUpgradeableGuard
A upgradable guard that provides read access to the data protected by a Arc<RwLock>.
ArcRwLockWriteGuard
A guard that provides exclusive write access to the data protected by a Arc<RwLock>.
ArcRwMutexReadGuard
A guard that provides shared read access to the data protected by a Arc<RwMutex>.
ArcRwMutexUpgradeableGuard
A upgradable guard that provides read access to the data protected by a Arc<RwMutex>.
ArcRwMutexWriteGuard
A guard that provides exclusive write access to the data protected by a Arc<RwMutex>.
ArcSpinLockGuard
A guard that provides exclusive access to the data protected by a Arc<SpinLock>.
MutexGuard
A guard that provides exclusive access to the data protected by a Mutex.
RwLockReadGuard
A guard that provides shared read access to the data protected by a RwLock.
RwLockUpgradeableGuard
A upgradable guard that provides read access to the data protected by a RwLock.
RwLockWriteGuard
A guard that provides exclusive write access to the data protected by a RwLock.
RwMutexReadGuard
A guard that provides shared read access to the data protected by a RwMutex.
RwMutexUpgradeableGuard
A upgradable guard that provides read access to the data protected by a RwMutex.
RwMutexWriteGuard
A guard that provides exclusive write access to the data protected by a RwMutex.
SpinLockGuard
A guard that provides exclusive access to the data protected by a SpinLock.