Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReleaseLock ¶ added in v1.0.0
ReleaseLock unlocks key with defaultLocker.
Types ¶
type LockerPool ¶
LockerPool is a set of reader/writer mutual exclusion locks.
func NewLockerPool ¶
func NewLockerPool() *LockerPool
NewLockerPool returns a *LockerPool with self-defined prefix.
func (*LockerPool) GetLock ¶
func (l *LockerPool) GetLock(key string, ro bool)
GetLock locks key. If ro(readonly) is true, then it locks key for reading. Otherwise, locks key for writing.
func (*LockerPool) ReleaseLock ¶
func (l *LockerPool) ReleaseLock(key string, ro bool)
ReleaseLock unlocks key. If ro(readonly) is true, then it unlocks key for reading. Otherwise, unlocks key for writing.