[#BloombergLP-bslmt-RWMutex-tryLockWrite]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/RWMutex.adoc[RWMutex]::tryLockWrite
:relfileprefix: ../../../
:mrdocs:

Attempt to lock this reader&hyphen;writer mutex for writing&period;

== Synopsis

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

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

== Description

Immediately return 0 on success, and a non&hyphen;zero value if there are active or pending locks on this mutex&period; If successful, `unlock` must be used to release the lock on this mutex&period; The behavior is undefined if this method is called from a thread that already has a lock on this mutex&period;

== Return Value

0 on success, and a non&hyphen;zero value if there are active or pending locks on this mutex


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