[#BloombergLP-bslmt-TimedSemaphore-timedWait-08]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/TimedSemaphore.adoc[TimedSemaphore]::timedWait
:relfileprefix: ../../../
:mrdocs:

Block until the count of this semaphore is a positive value, or until the specified `absTime` timeout expires&period; `absTime` is an _absolute_ time represented by a time point with respect to some epoch, which is determined by the clock associated with the time point&period; If the `absTime` timeout did not expire before the count attained a positive value, atomically decrement the count and return 0&period; If the `absTime` timeout did expire, return `e&lowbar;TIMED&lowbar;OUT` with no effect on the count&period; Any other value indicates that an error has occurred&period; Errors are unrecoverable&period; After an error, the semaphore may be destroyed, but any other use has undefined behavior&period; On Windows platforms, this method may return `e&lowbar;TIMED&lowbar;OUT` slightly before `absTime`&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;timedsemaphore&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);
----


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