9 #ifndef CPPCOMMON_THREADS_SPIN_BARRIER_H
10 #define CPPCOMMON_THREADS_SPIN_BARRIER_H
46 int threads() const noexcept {
return _threads; }
57 std::atomic<
int> _counter;
58 std::atomic<
int> _generation;
66 #include "spin_barrier.inl"
Spin barrier synchronization primitive.
int threads() const noexcept
Get the count of threads to wait at the barrier.
SpinBarrier(const SpinBarrier &)=delete
bool Wait() noexcept
Wait at the barrier until all other threads reach this barrier.
SpinBarrier & operator=(const SpinBarrier &)=delete
SpinBarrier(SpinBarrier &&)=delete
SpinBarrier(int threads) noexcept
Default class constructor.
SpinBarrier & operator=(SpinBarrier &&)=delete
C++ Common project definitions.