Sleeping Wombat GUI  0.100
swGUI
Public Member Functions | Private Attributes | List of all members
sw::ThreadsBarrier Class Reference

Can block multiple threads and wait for signal. ThreadsBarrier is reusable. More...

#include <ThreadsBarrier.h>

Public Member Functions

 ThreadsBarrier (uint16 numThreads)
 
 ~ThreadsBarrier ()=default
 
void ArriveAndWait ()
 

Private Attributes

std::mutex m_lock
 
std::condition_variable m_condVariable
 
Size m_generation
 
const uint32 m_numThreads
 
uint32 m_remain
 

Detailed Description

Can block multiple threads and wait for signal. ThreadsBarrier is reusable.

Implementation based on http://stackoverflow.com/questions/24465533/implementing-boostbarrier-in-c11

Todo:
Implement

Constructor & Destructor Documentation

sw::ThreadsBarrier::ThreadsBarrier ( uint16  numThreads)
explicit
sw::ThreadsBarrier::~ThreadsBarrier ( )
default

Member Function Documentation

void sw::ThreadsBarrier::ArriveAndWait ( )

Member Data Documentation

std::condition_variable sw::ThreadsBarrier::m_condVariable
private
Size sw::ThreadsBarrier::m_generation
private
std::mutex sw::ThreadsBarrier::m_lock
private
const uint32 sw::ThreadsBarrier::m_numThreads
private
uint32 sw::ThreadsBarrier::m_remain
private

The documentation for this class was generated from the following files: