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

Lock this reader&sol;writer lock for read and reserve a write lock&period;

== Synopsis

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

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

== Description

Lock this reader&sol;writer lock for read and reserve a write lock so that a call to `upgradeToWriteLock` is guaranteed to upgrade atomically&period; If there are no pending or active write locks, the call will return immediately, otherwise it will block until it all active and pending writes have completed&period; The lock may then be atomically converted to a write lock by calling `upgradeToWriteLock`&period; Use `unlock` to release the lock&period;


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