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

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 as determined by the clock specified at construction (see &lcub;Supported Clock&hyphen;Types&rcub; in the component&hyphen;level documentation)&period; Note that a return value of 0 does not guarantee this object is safe to destroy&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
timedWait(xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& absTime);
----


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