Barrier class
#include <nCine/Threading/ThreadSync.h>
Barrier for thread synchronization.
Blocks each arriving thread until the configured number of threads have reached the barrier, then releases them all at once. Wraps a pthread_barrier_t and is therefore unavailable on Android, Apple and Windows. Non-copyable.
Constructors, destructors, conversion operators
-
Barrier(std::
uint32_t count) explicit - Creates a barrier for the given number of waiting threads.
- ~Barrier()
- Barrier(const Barrier&) deleted
Public functions
- auto operator=(const Barrier&) -> Barrier& deleted
-
auto Wait() -> std::
int32_t - Blocks the calling thread until the required number of threads have arrived.