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

Attempt to lock this reader&sol;writer lock for write&period;

== Synopsis

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

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

== Description

Attempt to lock this reader&sol;writer lock for write&period; Return 0 on success, and a non&hyphen;zero value if the lock already locked for read or write&period; If successful, `unlock` must be called to release the lock&period;

== Return Value

0 on success, and a non&hyphen;zero value if already locked for read or write


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