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

This class implements a semaphore type, optimized for `post`, for thread synchronization&period;

== Synopsis

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

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

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/FastPostSemaphore/ReturnValue.adoc[`ReturnValue`] 
| Status codes returned by semaphore operations&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/FastPostSemaphore/2constructor-0f.adoc[`FastPostSemaphore`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslmt/FastPostSemaphore/clockType.adoc[`clockType`] 
| Return the clock type used for timeouts&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/disable.adoc[`disable`] 
| Disable waiting on this semaphore&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/enable.adoc[`enable`] 
| Enable waiting on this semaphore&period; If the semaphore is not disabled, this call has no effect&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/getDisabledState.adoc[`getDisabledState`] 
| Return an odd value if this semaphore is wait disabled, and an even value otherwise&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/getValue.adoc[`getValue`] 
| Return the current value (`count &gt; 0 ? count &colon; 0`) of this semaphore&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/isDisabled.adoc[`isDisabled`] 
| Return `true` if this semaphore is wait disabled, and `false` otherwise&period; Note that the semaphore is created in the &quot;wait enabled&quot; state&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/post-0c.adoc[`post`] 
| `post` overloads
| xref:BloombergLP/bslmt/FastPostSemaphore/postWithRedundantSignal.adoc[`postWithRedundantSignal`] 
| Atomically increase the count of this semaphore by the specified `value`&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/take.adoc[`take`] 
| Take up to `maximumToTake` units from this semaphore&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/takeAll.adoc[`takeAll`] 
| If the count of this semaphore is positive, reduce the count to 0 and return the original value of the count&period; Otherwise, do nothing and return 0&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/timedWait-02.adoc[`timedWait`] 
| Block until this semaphore can be acquired or `absTime` expires&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/tryWait.adoc[`tryWait`] 
| Attempt to decrement this semaphore&apos;s count without blocking&period;
| xref:BloombergLP/bslmt/FastPostSemaphore/wait.adoc[`wait`] 
| Block until this semaphore&apos;s count is positive, then decrement it&period;
|===



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