blocxx
|
The ThreadBarrier class is used to synchronize threads. More...
#include <ThreadBarrier.hpp>
Public Member Functions | |
ThreadBarrier (UInt32 threshold) | |
Constructor. | |
void | wait () |
Synchronize participating threads at the barrier. | |
~ThreadBarrier () | |
ThreadBarrier (const ThreadBarrier &x) | |
ThreadBarrier & | operator= (const ThreadBarrier &x) |
Private Attributes | |
IntrusiveReference < ThreadBarrierImpl > | m_impl |
The ThreadBarrier class is used to synchronize threads.
Each thread that calls wait() will block until threshold number of threads has called wait() This class is freely copyable. All copies reference the same underlying implementation.
Note that descriptions of what exceptions may be thrown assumes that the object is used correctly, i.e., method preconditions are satsified.
Definition at line 59 of file ThreadBarrier.hpp.
BLOCXX_NAMESPACE::ThreadBarrier::ThreadBarrier | ( | UInt32 | threshold | ) |
Constructor.
threshold | The number of threads that must call wait() before any of them successfully return from the call. The value specified by threshold must be greater than zero. |
ThreadBarrierException | if needed system resources exhausted. |
std::bad_alloc | if memory exhausted. |
Definition at line 166 of file ThreadBarrier.cpp.
References BLOCXX_ASSERT.
BLOCXX_NAMESPACE::ThreadBarrier::~ThreadBarrier | ( | ) |
Definition at line 177 of file ThreadBarrier.cpp.
BLOCXX_NAMESPACE::ThreadBarrier::ThreadBarrier | ( | const ThreadBarrier & | x | ) |
Definition at line 181 of file ThreadBarrier.cpp.
ThreadBarrier & BLOCXX_NAMESPACE::ThreadBarrier::operator= | ( | const ThreadBarrier & | x | ) |
Definition at line 186 of file ThreadBarrier.cpp.
References m_impl.
void BLOCXX_NAMESPACE::ThreadBarrier::wait | ( | ) |
Synchronize participating threads at the barrier.
The calling thread shall block until the required number of threads have called wait().
ThreadBarrierException | (programmer error only) |
ThreadCancelledException |
Definition at line 172 of file ThreadBarrier.cpp.
References m_impl.
Referenced by BLOCXX_NAMESPACE::Thread::start(), and BLOCXX_NAMESPACE::Thread::threadRunner().
Definition at line 87 of file ThreadBarrier.hpp.
Referenced by operator=(), and wait().