[#BloombergLP-bslmt-TimedSemaphoreImpl-04b]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/TimedSemaphoreImpl-09.adoc[TimedSemaphoreImpl]&lt;xref:BloombergLP/bslmt/Platform/PthreadTimedSemaphore.adoc[Platform::PthreadTimedSemaphore]&gt;
:relfileprefix: ../../
:mrdocs:

This class implements a portable semaphore type for thread synchronization&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;timedsemaphoreimpl&lowbar;pthread&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
class xref:BloombergLP/bslmt/TimedSemaphoreImpl-09.adoc[TimedSemaphoreImpl]&lt;xref:BloombergLP/bslmt/Platform/PthreadTimedSemaphore.adoc[Platform::PthreadTimedSemaphore]&gt;;
----

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/_04enum.adoc[`Unnamed enum`] 
| The value `timedWait` returns when a timeout occurs&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/2constructor-03a.adoc[`TimedSemaphoreImpl`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/2destructor.adoc[`&#126;TimedSemaphoreImpl`] [.small]#[destructor]#
| Destroy this semaphore object&period;
| xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/clockType.adoc[`clockType`] 
| Return the clock type used for timeouts&period;
| xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/post-0b.adoc[`post`] 
| `post` overloads
| xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/timedWait.adoc[`timedWait`] 
| 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 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 documentation)&period; If the `absTime` timeout did not expire before the count attained a positive value, atomically decrement the count and return 0&semi; otherwise, return a non&hyphen;zero value with no effect on the count&period;
| xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/tryWait.adoc[`tryWait`] 
| Decrement the count of this semaphore if it is positive and return 0&period; Return a non&hyphen;zero value otherwise&period;
| xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/wait.adoc[`wait`] 
| Block until the count is a positive value and atomically decrement it&period;
|===



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