9#ifndef CPPCOMMON_THREADS_BARRIER_H
10#define CPPCOMMON_THREADS_BARRIER_H
56 Impl& impl() noexcept {
return reinterpret_cast<Impl&
>(_storage); }
57 const Impl& impl() const noexcept {
return reinterpret_cast<Impl const&
>(_storage); }
59 static const size_t StorageSize = 128;
60 static const size_t StorageAlign = 8;
61 alignas(StorageAlign) std::byte _storage[StorageSize];
Barrier synchronization primitive.
int threads() const noexcept
Get the count of threads to wait at the barrier.
Barrier & operator=(Barrier &&barrier)=delete
Barrier(Barrier &&barrier)=delete
Barrier & operator=(const Barrier &)=delete
bool Wait()
Wait at the barrier until all other threads reach this barrier.
Barrier(const Barrier &)=delete
C++ Common project definitions.