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

Attempt to lock this reader&hyphen;writer mutex for writing&period; Immediately return 0 on success, and a non&hyphen;zero value if there are active or pending locks on this mutex&period; If successful, `unlockWrite` or `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;

== Synopsis

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

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


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