Documentation ¶
Index ¶
- type KeyMutex
- type KeyRWMutex
- func (km *KeyRWMutex) Lock(k string)
- func (km *KeyRWMutex) LockBytes(k []byte)
- func (km *KeyRWMutex) RLock(k string)
- func (km *KeyRWMutex) RLockBytes(k []byte)
- func (km *KeyRWMutex) RUnlock(k string)
- func (km *KeyRWMutex) RUnlockBytes(k []byte)
- func (km *KeyRWMutex) Unlock(k string)
- func (km *KeyRWMutex) UnlockBytes(k []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyMutex ¶
type KeyMutex struct {
// contains filtered or unexported fields
}
func New ¶
New returns a new instance of KeyMutex which hashes arbitrary keys to a fixed set of locks, specified by n. Use the default value if n <= 0.
func (*KeyMutex) UnlockBytes ¶
type KeyRWMutex ¶ added in v0.1.0
type KeyRWMutex struct {
// contains filtered or unexported fields
}
func NewRW ¶ added in v0.1.0
func NewRW(n int) *KeyRWMutex
NewRW returns a new instance of KeyRWMutex which hashes arbitrary keys to a fixed set of RWMutexes, specified by n. Use the default value if n <= 0.
func (*KeyRWMutex) Lock ¶ added in v0.1.0
func (km *KeyRWMutex) Lock(k string)
Lock acquires the lock for the specified key.
func (*KeyRWMutex) LockBytes ¶ added in v0.1.0
func (km *KeyRWMutex) LockBytes(k []byte)
func (*KeyRWMutex) RLock ¶ added in v0.1.0
func (km *KeyRWMutex) RLock(k string)
RLock acquires the shared lock for the specified key.
func (*KeyRWMutex) RLockBytes ¶ added in v0.1.0
func (km *KeyRWMutex) RLockBytes(k []byte)
func (*KeyRWMutex) RUnlock ¶ added in v0.1.0
func (km *KeyRWMutex) RUnlock(k string)
RUnlock releases the shared lock for the specified key.
func (*KeyRWMutex) RUnlockBytes ¶ added in v0.1.0
func (km *KeyRWMutex) RUnlockBytes(k []byte)
func (*KeyRWMutex) Unlock ¶ added in v0.1.0
func (km *KeyRWMutex) Unlock(k string)
Unlock releases the lock for the specified key.
func (*KeyRWMutex) UnlockBytes ¶ added in v0.1.0
func (km *KeyRWMutex) UnlockBytes(k []byte)
Click to show internal directories.
Click to hide internal directories.