[#BloombergLP-bslmt-Latch-2constructor-08]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/Latch.adoc[Latch]::Latch
:relfileprefix: ../../../
:mrdocs:

Create a latch that synchronizes on the specified `count` events&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
Latch(
    int count,
    xref:BloombergLP/bsls/SystemClockType/Enum.adoc[bsls::SystemClockType::Enum] clockType = bsls&colon;&colon;SystemClockType&colon;&colon;e&lowbar;REALTIME);
----

== Description

Create a latch that will synchronize on the specified `count` number of events, and when `count` events have been recorded will release any waiting threads&period; Optionally specify a `clockType` indicating the type of the system clock against which the `bsls&colon;&colon;TimeInterval` `absTime` timeouts passed to the `timedWait` method are to be interpreted&period; If `clockType` is not specified then the realtime system clock is used&period; The behavior is undefined unless `0 &lt;&equals; count`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *count*
| number of events required to release the latch
| *clockType*
| clock used to interpret `timedWait` timeouts
|===


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