Module sync

Source
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.
BarrierWaitResult
A BarrierWaitResult is returned by Barrier::wait() when all threads in the Barrier have rendezvoused.
Condvar
A Condition Variable
Mutex
A mutual exclusion primitive useful for protecting shared data
MutexGuard
An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
WaitTimeoutResult
A type indicating whether a timed wait on a condition variable returned due to a time out or not.

Enums§

TryLockError
An enumeration of possible errors associated with a TryLockResult which can occur while trying to acquire a lock, from the try_lock method on a Mutex.

Type Aliases§

TryLockResult
A type alias for the result of a nonblocking locking method.