[#BloombergLP-bslmt-RecursiveMutex-tryLock] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/RecursiveMutex.adoc[RecursiveMutex]::tryLock :relfileprefix: ../../../ :mrdocs: Attempt to acquire a lock on this object. Return 0 on success, and a non‐zero value if this object is already locked by another thread, or if an error occurs. Succeed immediately if this thread already holds the lock. == Synopsis Declared in `<bslmt_recursivemutex.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int tryLock(); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#