[#BloombergLP-bslmt-SemaphoreImpl-06]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/SemaphoreImpl-0a.adoc[SemaphoreImpl]&lt;xref:BloombergLP/bslmt/Platform/PosixSemaphore.adoc[Platform::PosixSemaphore]&gt;
:relfileprefix: ../../
:mrdocs:

This class provides a full specialization of `SemaphoreImpl` for pthreads&period; The implementation provided here defines an efficient proxy for the `sem&lowbar;t` pthread type, and related operations&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;semaphoreimpl&lowbar;pthread&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
class xref:BloombergLP/bslmt/SemaphoreImpl-0a.adoc[SemaphoreImpl]&lt;xref:BloombergLP/bslmt/Platform/PosixSemaphore.adoc[Platform::PosixSemaphore]&gt;;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/SemaphoreImpl-06/2constructor.adoc[`SemaphoreImpl`]         [.small]#[constructor]#
| Create a semaphore initialized to the specified `count`&period; This method does not return normally unless there are sufficient system resources to construct the object&period;
| xref:BloombergLP/bslmt/SemaphoreImpl-06/2destructor.adoc[`&#126;SemaphoreImpl`] [.small]#[destructor]#
| Destroy a semaphore
| xref:BloombergLP/bslmt/SemaphoreImpl-06/getValue.adoc[`getValue`] 
| Return the current value of this semaphore&period;
| xref:BloombergLP/bslmt/SemaphoreImpl-06/post-00.adoc[`post`] 
| `post` overloads
| xref:BloombergLP/bslmt/SemaphoreImpl-06/tryWait.adoc[`tryWait`] 
| Decrement the count of this semaphore if it is positive and return 0&period; Return a non&hyphen;zero value otherwise&period;
| xref:BloombergLP/bslmt/SemaphoreImpl-06/wait.adoc[`wait`] 
| Block until the count of this semaphore is a positive value and atomically decrement it&period;
|===



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