MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 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 53 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 70 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 55 of file barrier.cpp.


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