[#BloombergLP-bslmt-FastPostSemaphoreImpl] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::FastPostSemaphoreImpl :relfileprefix: ../../ :mrdocs: This class implements a semaphore type, optimized for `post`, for thread synchronization. == Synopsis Declared in `<bslmt_fastpostsemaphoreimpl.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ATOMIC_OP, class MUTEX, class CONDITION, class THREADUTIL> class FastPostSemaphoreImpl; ---- == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/ReturnValue.adoc[`ReturnValue`] | Status codes returned by semaphore operations. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/2constructor-09.adoc[`FastPostSemaphoreImpl`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/clockType.adoc[`clockType`] | Return the clock type used for timeouts. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/disable.adoc[`disable`] | Disable waiting on this semaphore. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/enable.adoc[`enable`] | Enable waiting on this semaphore. If the semaphore is initially enabled, this call has no effect. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/getDisabledState.adoc[`getDisabledState`] | Return an odd value if this semaphore is wait disabled, and an even value otherwise. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/getValue.adoc[`getValue`] | Return the current value (`count > 0 ? count : 0`) of this semaphore. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/getValueRaw.adoc[`getValueRaw`] | Return the current value (`count`) of this semaphore. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/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/FastPostSemaphoreImpl/post-03.adoc[`post`] | `post` overloads | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/postWithRedundantSignal.adoc[`postWithRedundantSignal`] | Atomically increase the count of this semaphore by the specified `value`. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/take.adoc[`take`] | Reduce the count by up to `maximumToTake` and return the amount taken. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/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/FastPostSemaphoreImpl/timedWait.adoc[`timedWait`] | Block until a resource is available or `absTime` expires, then acquire it. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/tryWait.adoc[`tryWait`] | Attempt to acquire a resource without blocking. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/wait.adoc[`wait`] | Block until a resource is available and acquire it. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/k_AVAILABLE_INC.adoc[`k_AVAILABLE_INC`] | Increment value for the available count in `d_state`. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/k_AVAILABLE_MASK.adoc[`k_AVAILABLE_MASK`] | Mask for the available‐count field in `d_state`. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/k_AVAILABLE_SHIFT.adoc[`k_AVAILABLE_SHIFT`] | Bit shift for the available‐count field in `d_state`. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/k_BLOCKED_INC.adoc[`k_BLOCKED_INC`] | Increment value for the blocked‐thread count in `d_state`. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/k_BLOCKED_MASK.adoc[`k_BLOCKED_MASK`] | Mask for the blocked‐thread count field in `d_state`. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/k_DISABLED_GEN_INC.adoc[`k_DISABLED_GEN_INC`] | Increment value for the disabled‐generation count in `d_state`. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/k_DISABLED_GEN_MASK.adoc[`k_DISABLED_GEN_MASK`] | Mask for the disabled‐generation field in `d_state`. | xref:BloombergLP/bslmt/FastPostSemaphoreImpl/k_DISABLED_GEN_SHIFT.adoc[`k_DISABLED_GEN_SHIFT`] | Bit shift for the disabled‐generation field in `d_state`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#