Waits for a number of threads to reach a certain point (i.e. the call to Barrier::waitForAll). Once everyone has arrived, everyone is released.
More...
Waits for a number of threads to reach a certain point (i.e. the call to Barrier::waitForAll). Once everyone has arrived, everyone is released.
Threads::Barrier::Barrier |
( |
int |
nrthreads = -1 , |
|
|
bool |
immediatrelease = true |
|
) |
| |
Mutex& Threads::Barrier::mutex |
( |
| ) |
|
|
inline |
int Threads::Barrier::nrThreads |
( |
| ) |
const |
|
inline |
void Threads::Barrier::releaseAll |
( |
| ) |
|
void Threads::Barrier::releaseAllInternal |
( |
| ) |
|
|
protected |
void Threads::Barrier::releaseAllNoLock |
( |
| ) |
|
void Threads::Barrier::setNrThreads |
( |
int |
| ) |
|
bool Threads::Barrier::waitForAll |
( |
bool |
unlock = true | ) |
|
- Returns
- true if current thread is the first one to return. If immediaterelease_ is false, this thread has to release all other threads with releaseAll() or releaseAllNoLock().
- Parameters
-
unlock | If false, the mutex will still be locked when returning, and mutex().unLock() must be called to allow other threads to be released(). |
bool Threads::Barrier::dorelease_ |
|
protected |
bool Threads::Barrier::immediaterelease_ |
|
protected |
int Threads::Barrier::nrthreads_ |
|
protected |
int Threads::Barrier::threadcount_ |
|
protected |