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

This class implements a portable timed semaphore type for thread synchronization&period; It forwards all requests to an appropriate platform&hyphen;specific implementation&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class TimedSemaphore;
----

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/TimedSemaphore/_04enum.adoc[`Unnamed enum`] 
| Status codes for timed wait operations&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/TimedSemaphore/2constructor-0a0.adoc[`TimedSemaphore`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslmt/TimedSemaphore/2destructor.adoc[`&#126;TimedSemaphore`] [.small]#[destructor]#
| Destroy this timed semaphore&period;
| xref:BloombergLP/bslmt/TimedSemaphore/clockType.adoc[`clockType`] 
| Return the clock type used for timeouts&period;
| xref:BloombergLP/bslmt/TimedSemaphore/post-00.adoc[`post`] 
| `post` overloads
| xref:BloombergLP/bslmt/TimedSemaphore/timedWait-09.adoc[`timedWait`] 
| `timedWait` overloads
| xref:BloombergLP/bslmt/TimedSemaphore/tryWait.adoc[`tryWait`] 
| If the count of this timed semaphore is positive, 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/TimedSemaphore/wait.adoc[`wait`] 
| Block until the count of this timed semaphore is a positive value, then atomically decrement the count and return&period;
|===



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