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.