Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
Barrier with changeable threshold. More...
|FXBarrier (FXuint thr=1)|
|Initialize the barrier with initial threshold thr. |
|FXbool||threshold (FXuint thr)|
|Change threshold to thr, possibly releasing all waiting threads. More...|
|FXuint||threshold () const|
|Return the threshold, i.e. More...|
|Wait for all threads to hit the barrier. More...|
|Release all waiting threads unconditionally; all waiting threads will break through the barrier and proceed, even if the threshold was not exceeded. More...|
|Delete the barrier. |
Barrier with changeable threshold.
A Barrier holds back threads arriving at the barrier, until the number of threads exceeds some threshold (quorum), after which all threads can progress. The Barrier can be broken in two additional ways. First, the threshold value could be changed to a number lower than the currently waiting number of threads. Second, the waiting threads could be released unconditionally, without reaching quorum. Since there must be at least one thread, the theshold value should be at least 1. Deleting the barrier while threads are blocked in not allowed.
Release all waiting threads unconditionally; all waiting threads will break through the barrier and proceed, even if the threshold was not exceeded.
Return true if any threads were waiting.
Change threshold to thr, possibly releasing all waiting threads.
Return true if current count now exceeds the threshold.
Return the threshold, i.e.
number at which the barrier breaks through.
Wait for all threads to hit the barrier.
Returns true for one thread, false for all other threads.
|Copyright © 1997-2018 Jeroen van der Zijp|