[#BloombergLP-bslmt-ReaderWriterMutex-lockWrite]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/ReaderWriterMutex.adoc[ReaderWriterMutex]::lockWrite
:relfileprefix: ../../../
:mrdocs:

Lock this reader&hyphen;writer mutex for writing&period;

== Synopsis

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

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

== Description

If there are no active or pending locks on this mutex, lock this mutex for writing and return immediately&period; Otherwise, block until the write lock on this mutex is acquired&period; Use `unlockWrite` or `unlock` 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;


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