UpgradableRWMutex is an enhanced version of the standard sync.RWMutex. It has the all methods sync.RWMutex with exact same semantics. It gives more methods to give upgradable-read feature.
The new semantics for upgradable-read are as follows:
- Multiple goroutines can get read-lock together with a single upgradable-read-lock.
- Only one goroutine can have a write-lock and no read-lock/upgradable-read-lock can be acquired in this state.