[#BloombergLP-bslmt-RecursiveMutexImpl-01-lock]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/RecursiveMutexImpl-01.adoc[RecursiveMutexImpl&lt;Platform::PosixThreads&gt;]::lock
:relfileprefix: ../../../
:mrdocs:

Acquire a lock on this mutex object&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
lock();
----

== Description

If this object is currently locked by a different thread, then suspend execution of the current thread until a lock can be acquired&period; Otherwise, if it unlocked, or locked by the calling thread, then grant ownership of the lock immediately and return&period; Note that when this object is recursively locked by a thread, `unlock` must be called an equal number of times before the lock is actually released&period;


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