[#BloombergLP-bslmt-TimedSemaphoreImpl-04b] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/TimedSemaphoreImpl-09.adoc[TimedSemaphoreImpl]<xref:BloombergLP/bslmt/Platform/PthreadTimedSemaphore.adoc[Platform::PthreadTimedSemaphore]> :relfileprefix: ../../ :mrdocs: This class implements a portable semaphore type for thread synchronization. == Synopsis Declared in `<bslmt_timedsemaphoreimpl_pthread.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> class xref:BloombergLP/bslmt/TimedSemaphoreImpl-09.adoc[TimedSemaphoreImpl]<xref:BloombergLP/bslmt/Platform/PthreadTimedSemaphore.adoc[Platform::PthreadTimedSemaphore]>; ---- == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/_04enum.adoc[`Unnamed enum`] | The value `timedWait` returns when a timeout occurs. |=== == 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[`~TimedSemaphoreImpl`] [.small]#[destructor]# | Destroy this semaphore object. | xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/clockType.adoc[`clockType`] | Return the clock type used for timeouts. | xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/post-0b.adoc[`post`] | `post` overloads | xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/timedWait.adoc[`timedWait`] | Block until this semaphore can be acquired or `absTime` expires. | xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/tryWait.adoc[`tryWait`] | Decrement the count of this semaphore if it is positive and return 0. Return a non‐zero value otherwise. | xref:BloombergLP/bslmt/TimedSemaphoreImpl-04b/wait.adoc[`wait`] | Block until the count is a positive value and atomically decrement it. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#