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.
<>
◆ Barrier()
Threads::Barrier::Barrier |
( |
int |
nrthreads = -1 , |
|
|
bool |
immediatrelease = true |
|
) |
| |
◆ mutex()
Mutex& Threads::Barrier::mutex |
( |
| ) |
|
|
inline |
◆ nrThreads()
int Threads::Barrier::nrThreads |
( |
| ) |
const |
|
inline |
◆ releaseAll()
void Threads::Barrier::releaseAll |
( |
| ) |
|
◆ releaseAllInternal()
void Threads::Barrier::releaseAllInternal |
( |
| ) |
|
|
protected |
◆ releaseAllNoLock()
void Threads::Barrier::releaseAllNoLock |
( |
| ) |
|
◆ setNrThreads()
void Threads::Barrier::setNrThreads |
( |
int |
| ) |
|
◆ waitForAll()
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(). |
◆ condvar_
◆ dorelease_
bool Threads::Barrier::dorelease_ |
|
protected |
◆ immediaterelease_
bool Threads::Barrier::immediaterelease_ |
|
protected |
◆ nrthreads_
int Threads::Barrier::nrthreads_ |
|
protected |
◆ threadcount_
int Threads::Barrier::threadcount_ |
|
protected |