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

Atomically unlock the specified `mutex` and suspend execution of the current thread until this condition object is &quot;signaled&quot; (i&period;e&period;, one of the `signal` or `broadcast` methods is invoked on this object) or until the specified `absTime` timeout expires, then re&hyphen;acquire a lock on the `mutex`&period; `absTime` is an _absolute_ time represented as an interval from some epoch, which is determined by the clock associated with the time point, and is the earliest time at which the timeout may occur&period; The `mutex` remains locked by the calling thread upon returning from this function&period; Return 0 on success, and `e&lowbar;TIMED&lowbar;OUT` on timeout&period; Any other value indicates that an error has occurred&period; After an error, the condition may be destroyed, but any other use has undefined behavior&period; The behavior is undefined unless `mutex` is locked by the calling thread prior to calling this method&period; Note that spurious wakeups are rare but possible, i&period;e&period;, this method may succeed (return 0) and return control to the thread without the condition object being signaled&period; Also note that the actual time of the timeout depends on many factors including system scheduling and system timer resolution, and may be significantly later than the time requested&period; Also note that the lock on `mutex` may be released and reacquired more than once before this method returns&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CLOCK,
    class DURATION&gt;
int
timedWait(
    xref:BloombergLP/bslmt/Mutex.adoc[Mutex]* mutex,
    bsl::chrono::time&lowbar;point&lt;CLOCK, DURATION&gt; const& absTime);
----


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