Extended sync.RWMutex which have TryLock()
and TryRLock()
.
Use sync.Mutex
and sync.RWMutex
internally, not channel.
Of course TryLock()
TryRLock()
never blocks so long.
trwmutex.TRWMutex
can be used as sync.RWMutex
with same interface.
go get github.com/kawasin73/trwmutex
Lock()
TryLock() -> bool
Unlock()
RLock()
TryRLock() -> bool
RUnlock()
MIT