[#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. Return 0 if the upgrade operation was atomic, and a non‐zero value otherwise. If there are other active read locks, the call will block until all current read locks are released. Note that locks that were acquired through `lockReadReserveWrite` are guaranteed to upgrade atomically. Use `unlock` to release this lock. == Synopsis Declared in `<bslmt_readerwriterlock.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int upgradeToWriteLock(); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#