[#BloombergLP-bslmt-Mutex-tryLock] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/Mutex.adoc[Mutex]::tryLock :relfileprefix: ../../../ :mrdocs: Attempt to acquire a lock on this mutex object. Return 0 on success, and a non‐zero value if this object is already locked by a different thread. The behavior is undefined if the calling thread already owns the lock on this mutex, and may result in deadlock. == Synopsis Declared in `<bslmt_mutex.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int tryLock(); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#