[#BloombergLP-bslmt-MutexImpl-06]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/MutexImpl-09.adoc[MutexImpl]&lt;xref:BloombergLP/bslmt/Platform/PosixThreads.adoc[Platform::PosixThreads]&gt;
:relfileprefix: ../../
:mrdocs:

Full specialization of `MutexImpl` for pthreads&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
class xref:BloombergLP/bslmt/MutexImpl-09.adoc[MutexImpl]&lt;xref:BloombergLP/bslmt/Platform/PosixThreads.adoc[Platform::PosixThreads]&gt;;
----

== Description

This class provides a full specialization of `MutexImpl` for pthreads&period; It provides a efficient proxy for the `pthread&lowbar;mutex&lowbar;t` pthreads type, and related operations&period; Note that the mutex implemented in this class is _not_ error checking, and is non&hyphen;recursive&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/MutexImpl-06/NativeType.adoc[`NativeType`] 
| The underlying OS&hyphen;level type&period; Exposed so that other `bslmt` components can operate directly on this mutex&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/MutexImpl-06/2constructor.adoc[`MutexImpl`]         [.small]#[constructor]#
| Create a mutex initialized to an unlocked state&period; This method does not return normally unless there are sufficient system resources to construct the object&period;
| xref:BloombergLP/bslmt/MutexImpl-06/2destructor.adoc[`&#126;MutexImpl`] [.small]#[destructor]#
| Destroy this mutex object&period; The behavior is undefined if the mutex is in a locked state&period;
| xref:BloombergLP/bslmt/MutexImpl-06/lock.adoc[`lock`] 
| Acquire a lock on this mutex object&period;
| xref:BloombergLP/bslmt/MutexImpl-06/nativeMutex.adoc[`nativeMutex`] 
| Return a reference to the modifiable OS&hyphen;level mutex underlying this object&period;
| xref:BloombergLP/bslmt/MutexImpl-06/tryLock.adoc[`tryLock`] 
| Attempt to acquire a lock on this mutex object&period; Return 0 on success, and a non&hyphen;zero value of this object is already locked, or if an error occurs&period;
| xref:BloombergLP/bslmt/MutexImpl-06/unlock.adoc[`unlock`] 
| Release a lock on this mutex&period;
|===



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