BloombergLP::bslmt::ReaderWriterLock::upgradeToWriteLock

Convert a held read lock to a write lock.

Synopsis

Declared in <bslmt_readerwriterlock.h>

int
upgradeToWriteLock();

Description

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.

Return Value

0 if the upgrade was atomic, and a non-zero value otherwise