[#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. == Synopsis Declared in `<bslmt_fastpostsemaphore.h>` [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. |=== == 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. | xref:BloombergLP/bslmt/FastPostSemaphore/disable.adoc[`disable`] | Disable waiting on this semaphore. | xref:BloombergLP/bslmt/FastPostSemaphore/enable.adoc[`enable`] | Enable waiting on this semaphore. If the semaphore is not disabled, this call has no effect. | xref:BloombergLP/bslmt/FastPostSemaphore/getDisabledState.adoc[`getDisabledState`] | Return an odd value if this semaphore is wait disabled, and an even value otherwise. | xref:BloombergLP/bslmt/FastPostSemaphore/getValue.adoc[`getValue`] | Return the current value (`count > 0 ? count : 0`) of this semaphore. | xref:BloombergLP/bslmt/FastPostSemaphore/isDisabled.adoc[`isDisabled`] | Return `true` if this semaphore is wait disabled, and `false` otherwise. Note that the semaphore is created in the "wait enabled" state. | 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`. | xref:BloombergLP/bslmt/FastPostSemaphore/take.adoc[`take`] | Take up to `maximumToTake` units from this semaphore. | 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. Otherwise, do nothing and return 0. | xref:BloombergLP/bslmt/FastPostSemaphore/timedWait-02.adoc[`timedWait`] | Block until this semaphore can be acquired or `absTime` expires. | xref:BloombergLP/bslmt/FastPostSemaphore/tryWait.adoc[`tryWait`] | Attempt to decrement this semaphore's count without blocking. | xref:BloombergLP/bslmt/FastPostSemaphore/wait.adoc[`wait`] | Block until this semaphore's count is positive, then decrement it. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#