[#BloombergLP-bslmt-Latch-timedWait-0b]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/Latch.adoc[Latch]::timedWait
:relfileprefix: ../../../
:mrdocs:

Block until this latch is released or `absTime` expires&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CLOCK,
    class DURATION&gt;
int
timedWait(bsl::chrono::time&lowbar;point&lt;CLOCK, DURATION&gt; const& absTime);
----

== Description

Block until the number of events that this latch is waiting for reaches 0, or until the specified `absTime` timeout expires&period; Return 0 on success, `e&lowbar;TIMED&lowbar;OUT` on timeout, and a non&hyphen;zero value different from `e&lowbar;TIMED&lowbar;OUT` if an error occurs&period; Errors are unrecoverable&period; After an error, the latch may be destroyed, but any other use has undefined behavior&period; `absTime` is an _absolute_ time represented as an interval from some epoch, which is determined by the clock associated with the time point&period; Note that a return value of 0 does not guarantee this object is safe to destroy&period;

== Return Value

0 on success, `e&lowbar;TIMED&lowbar;OUT` on timeout, or another value on error

== Parameters

[cols="1,4"]
|===
| Name| Description
| *absTime*
| absolute timeout from the time point&apos;s clock epoch
|===


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