Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Protected Attributes | List of all members
Mezzanine::Threading::Barrier Class Reference

A synchronization primitive that causes a predefined number of threads to all wait before continuing. More...

#include <barrier.h>

Public Member Functions

 Barrier (const Int32 &SynchThreadCount)
 Constructor. More...
 
void SetThreadSyncCount (Int32 NewCount)
 Set the Thread count Atomically. More...
 
bool Wait ()
 Wait until the specified number of threads reach this point. More...
 

Protected Attributes

Int32 IsBlocking
 Does calling wait on this barrier block at presemt. More...
 
Int32 ThreadCurrent
 The number of threads currently waiting.
 
Int32 ThreadGoal
 The number of threads to have wait.
 

Detailed Description

A synchronization primitive that causes a predefined number of threads to all wait before continuing.

Definition at line 58 of file barrier.h.

Constructor & Destructor Documentation

Mezzanine::Threading::Barrier::Barrier ( const Int32 SynchThreadCount)

Constructor.

Parameters
SynchThreadCountThe amount of threads that this should wait for. If 0 is passed all threads waiting advance.

Definition at line 55 of file barrier.cpp.

Member Function Documentation

void Mezzanine::Threading::Barrier::SetThreadSyncCount ( Int32  NewCount)

Set the Thread count Atomically.

Parameters
NewCountThe new amounf threads to sync.

Definition at line 84 of file barrier.cpp.

bool Mezzanine::Threading::Barrier::Wait ( )

Wait until the specified number of threads reach this point.

Returns
The last thread to reach this point gets true, the others are returned false.

Definition at line 61 of file barrier.cpp.

Member Data Documentation

Int32 Mezzanine::Threading::Barrier::IsBlocking
protected

Does calling wait on this barrier block at presemt.

1 waits, and 0 does not any other value indicates a bug

Definition at line 66 of file barrier.h.


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