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

Decrement the number of events that this latch is waiting for by 1, and if the resulting number of events is 0 release any waiting threads&semi; otherwise, block until the required number of events has been reached&period; The behavior is undefined unless the sum of all events that have arrived at this latch does not exceed the count with which it was initialized&period; Note that the initial count of events is supplied at construction&period; Also note that this method is equivalent to the following sequence&colon; &grave; arrive()&semi; wait()&semi; &grave;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
arriveAndWait();
----


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