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

Convert a read lock (acquired by a successful call to `lockRead`, `lockReadReserveWrite`, or `tryLockRead`) to a write lock&period; Return 0 if the upgrade operation was atomic, and a non&hyphen;zero value otherwise&period; If there are other active read locks, the call will block until all current read locks are released&period; Note that locks that were acquired through `lockReadReserveWrite` are guaranteed to upgrade atomically&period; Use `unlock` to release this lock&period;

== Synopsis

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

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


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