[#BloombergLP-bslmt-RecursiveMutex] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::RecursiveMutex :relfileprefix: ../../ :mrdocs: Recursive mutex that can be locked multiple times by the same thread. == Synopsis Declared in `<bslmt_recursivemutex.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class RecursiveMutex; ---- == Description This `class` implements a recursive mutex (i.e., a mutex that can be locked any number of times by a thread, and then released by unlocking the mutex the same number of times). If there is an efficient native recursive mutex, this class wraps it. Otherwise, a reasonably efficient proprietary implementation is used. Note that `Mutex` should be preferred if at all possible. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslmt/RecursiveMutex/2constructor.adoc[`RecursiveMutex`] [.small]#[constructor]# | Create a recursive mutex object in the unlocked state. | xref:BloombergLP/bslmt/RecursiveMutex/2destructor.adoc[`~RecursiveMutex`] [.small]#[destructor]# | Destroy this recursive mutex object. | xref:BloombergLP/bslmt/RecursiveMutex/lock.adoc[`lock`] | Acquire a lock on this mutex, blocking if necessary. | xref:BloombergLP/bslmt/RecursiveMutex/tryLock.adoc[`tryLock`] | Attempt to acquire a lock on this mutex without blocking. | xref:BloombergLP/bslmt/RecursiveMutex/unlock.adoc[`unlock`] | Release a previously acquired lock on this mutex. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#