[#BloombergLP-bslmt-Barrier]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::Barrier
:relfileprefix: ../../
:mrdocs:

This class defines a thread barrier&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;barrier&period;h&gt;`

[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&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/Barrier/2constructor-08.adoc[`Barrier`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslmt/Barrier/2destructor.adoc[`&#126;Barrier`] [.small]#[destructor]#
| Wait for all _signaled_ threads to unblock and destroy this barrier&period; (See `wait` and `timedWait` below for the meaning of _signaled_&period;) Note that the behavior is undefined if a barrier is destroyed while one or more threads are waiting on it&period;
| xref:BloombergLP/bslmt/Barrier/arrive.adoc[`arrive`] 
| Arrive on this barrier&period; 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&period;
| xref:BloombergLP/bslmt/Barrier/clockType.adoc[`clockType`] 
| Return the clock type used for timeouts&period;
| xref:BloombergLP/bslmt/Barrier/numArrivals.adoc[`numArrivals`] 
| Return the required number of arrivals before all waiting threads will unblock&period;
| xref:BloombergLP/bslmt/Barrier/numThreads.adoc[`numThreads`] 
| Return the required number of arrivals before all waiting threads will unblock&period;
| 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&period; 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&period; Note that generally `wait` and `timedWait` should not be used together, for reasons explained in the documentation of `timedWait`&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
