[#BloombergLP-bslmt-Barrier-timedWait-01]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/Barrier.adoc[Barrier]::timedWait
:relfileprefix: ../../../
:mrdocs:

`timedWait` overloads

== Synopses

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

Arrive and block until the required number of arrivals have occurred, or until the specified `absTime` timeout expires&period; In the former case, _signal_ all the threads that are currently waiting on this barrier to unblock, reset the state of this barrier to its initial state, and return 0&period; If this method times out before the required number of arrivals, the thread is released to proceed and ceases to contribute to the number of arrivals, and `e&lowbar;TIMED&lowbar;OUT` is returned&period; Any other return value indicates that an error has occurred&period; Errors are unrecoverable&period; After an error, the barrier 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 indicated at construction (see &lcub;Supported Clock&hyphen;Types&rcub; in the component&hyphen;level documentation)&period; Note that `timedWait` and `wait` should not generally be used together&semi; if one or more threads called `wait` while others called `timedWait`, then if the thread(s) that called `timedWait` were to time out and not retry, the threads that called `wait` would never unblock&period;


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

[.small]#xref:BloombergLP/bslmt/Barrier/timedWait-03f.adoc[_» more&period;&period;&period;_]#

Arrive and block until the required number of arrivals have occurred, or until the specified `absTime` timeout expires&period; In the former case, _signal_ all the threads that are currently waiting on this barrier to unblock, reset the state of this barrier to its initial state, and return 0&period; If this method times out before the required number of arrivals, the thread is released to proceed and ceases to contribute to the number of arrivals, and `e&lowbar;TIMED&lowbar;OUT` is returned&period; Any other return value indicates that an error has occurred&period; Errors are unrecoverable&period; After an error, the barrier 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 `timedWait` and `wait` should not generally be used together&semi; if one or more threads called `wait` while others called `timedWait`, then if the thread(s) that called `timedWait` were to time out and not retry, the threads that called `wait` would never unblock&period;


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

[.small]#xref:BloombergLP/bslmt/Barrier/timedWait-035.adoc[_» more&period;&period;&period;_]#


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