Expand description
Linux no_libc synchronization primitives.
§Higher-level synchronization objects
Sync-linux-no-libc currently reimplements the following
std::sync
synchronization objects:
-
Barrier
: Ensures multiple threads will wait for each other to reach a point in the program, before continuing execution all together. -
Condvar
: Condition Variable, providing the ability to block a thread while waiting for an event to occur. -
Mutex
: Mutual Exclusion mechanism, which ensures that at most one thread at a time is able to access some data. Unlike the std equivalent, it does not have a poison mechanism.
Structs§
- Barrier
- A barrier enables multiple threads to synchronize the beginning of some computation.
- Barrier
Wait Result - A
BarrierWaitResult
is returned byBarrier::wait()
when all threads in theBarrier
have rendezvoused. - Condvar
- A Condition Variable
- 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.
- Wait
Timeout Result - A type indicating whether a timed wait on a condition variable returned due to a time out or not.
Enums§
- TryLock
Error - An enumeration of possible errors associated with a
TryLockResult
which can occur while trying to acquire a lock, from thetry_lock
method on aMutex
.
Type Aliases§
- TryLock
Result - A type alias for the result of a nonblocking locking method.