[#BloombergLP-bslmt-MeteredMutex-tryLock]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/MeteredMutex.adoc[MeteredMutex]::tryLock
:relfileprefix: ../../../
:mrdocs:

Attempt to acquire the lock on this metered mutex&period; Return 0 on success, and a non&hyphen;zero value if this mutex is already locked, or if an error occurs&period; Update the wait and hold time appropriately&period; The behavior is undefined if the calling thread already owns the lock&period;

== Synopsis

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

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


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