github.com/voidingwarranties/motex (go): Package motex implements a demoteable and promoteable exclusion lock. Demoteable meaning a write lock can be changed to a read lock. Promoteable meaning a demoted write lock can be changed back to a write lock.  If Demote() and Promote() are never called, motex behaves identically to a sync.RWMutex.  A demoted lock continues to block calls to Lock, but calls to RLock will not block.  non-atomic read and update with sync.Mutex:  atomic read and update with motex.Motex:
Keywords: synchronization