Expand description
Data access synchronization objects.
These synchronization objects are similar to those in the std::sync
module, but they prevent data races when dealing with multiple actors (users or programs) instead of multiple threads considered in classic synchronization objects.
The following is an overview of the available synchronization objects:
Mutex
: The Mutual Exclusion mechanism guarantees that during execution, only a single actor can access data at any given time.RwLock
: Provides a mutual exclusion mechanism that allows multiple readings by different actors while allowing only one writer at the execution. In some cases, this can be more efficient than a mutex.
Structs§
- Mutex
- A mutual exclusion primitive useful for protecting shared data.
- Mutex
Guard - An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
- Mutex
Lock Future - The future returned by the
lock
method. - RwLock
- A reader-writer lock.
- RwLock
Read Future - The future returned by the
read
method. - RwLock
Read Guard - RAII structure used to release the shared read access of a lock when dropped.
- RwLock
Write Future - The future returned by the
write
method. - RwLock
Write Guard - RAII structure used to release the exclusive write access of a lock when dropped.