[#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 without blocking&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;mutex&period;h&gt;`

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

== Description

Attempt to acquire a lock on this mutex object&period; Return 0 on success, and a non&hyphen;zero value if this object is already locked by a different thread&period; The behavior is undefined if the calling thread already owns the lock on this mutex, and may result in deadlock&period;

== Return Value

0 on success, and a non&hyphen;zero value if already locked


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