[#BloombergLP-bslmt-Barrier] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::Barrier :relfileprefix: ../../ :mrdocs: This class defines a thread barrier. == Synopsis Declared in `<bslmt_barrier.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class Barrier; ---- == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/Barrier/_04enum.adoc[`Unnamed enum`] | Status codes for timed wait operations. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/Barrier/2constructor-08.adoc[`Barrier`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslmt/Barrier/2destructor.adoc[`~Barrier`] [.small]#[destructor]# | Wait for all _signaled_ threads to unblock and destroy this barrier. (See `wait` and `timedWait` below for the meaning of _signaled_.) Note that the behavior is undefined if a barrier is destroyed while one or more threads are waiting on it. | xref:BloombergLP/bslmt/Barrier/arrive.adoc[`arrive`] | Arrive on this barrier. If this is the last required arrival, _signal_ all the threads that are currently waiting on this barrier to unblock and reset the state of this barrier to its initial state. | xref:BloombergLP/bslmt/Barrier/clockType.adoc[`clockType`] | Return the clock type used for timeouts. | xref:BloombergLP/bslmt/Barrier/numArrivals.adoc[`numArrivals`] | Return the required number of arrivals before all waiting threads will unblock. | xref:BloombergLP/bslmt/Barrier/numThreads.adoc[`numThreads`] | Return the required number of arrivals before all waiting threads will unblock. | xref:BloombergLP/bslmt/Barrier/timedWait-01.adoc[`timedWait`] | `timedWait` overloads | xref:BloombergLP/bslmt/Barrier/wait.adoc[`wait`] | Arrive and block until the required number of arrivals have occurred. Then _signal_ all the threads that are currently waiting on this barrier to unblock and reset the state of this barrier to its initial state. Note that generally `wait` and `timedWait` should not be used together, for reasons explained in the documentation of `timedWait`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#