Documentation ¶
Index ¶
- type KeyLocker
- type KeyLockerGrp
- type Locker
- type TKeyLocker
- func (d *TKeyLocker[T]) Lock(key T)
- func (d *TKeyLocker[T]) Locks(keys []T)
- func (d *TKeyLocker[T]) RLock(key T)
- func (d *TKeyLocker[T]) RLocks(keys []T)
- func (d *TKeyLocker[T]) RUnlock(key T)
- func (d *TKeyLocker[T]) RUnlocks(keys []T)
- func (d *TKeyLocker[T]) Unlock(key T)
- func (d *TKeyLocker[T]) Unlocks(keys []T)
- type TKeyLockerGrp
- func (w *TKeyLockerGrp[T]) Lock(key T)
- func (w *TKeyLockerGrp[T]) Locks(keys []T)
- func (w *TKeyLockerGrp[T]) RLock(key T)
- func (w *TKeyLockerGrp[T]) RLocks(keys []T)
- func (w *TKeyLockerGrp[T]) RUnlock(key T)
- func (w *TKeyLockerGrp[T]) RUnlocks(keys []T)
- func (w *TKeyLockerGrp[T]) Unlock(key T)
- func (w *TKeyLockerGrp[T]) Unlocks(keys []T)
- type TLocker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyLocker ¶
type KeyLocker struct {
// contains filtered or unexported fields
}
KeyLocker global locker based on key
func NewKeyLockerInstance ¶ added in v0.8.9
func NewKeyLockerInstance() *KeyLocker
NewKeyLockerInstance new key locker instance
type KeyLockerGrp ¶ added in v0.8.9
type KeyLockerGrp struct {
// contains filtered or unexported fields
}
func (*KeyLockerGrp) Lock ¶ added in v0.8.9
func (w *KeyLockerGrp) Lock(key interface{})
Lock write lock
func (*KeyLockerGrp) RLock ¶ added in v0.8.9
func (w *KeyLockerGrp) RLock(key interface{})
RLock read lock
func (*KeyLockerGrp) RUnlock ¶ added in v1.2.1
func (w *KeyLockerGrp) RUnlock(key interface{})
RUnlock read unlock
func (*KeyLockerGrp) Unlock ¶ added in v0.8.9
func (w *KeyLockerGrp) Unlock(key interface{})
Unlock write unlock
type Locker ¶ added in v0.8.9
type Locker interface { // Lock write lock Lock(key interface{}) // Unlock write unlock Unlock(key interface{}) // RLock read lock RLock(key interface{}) // RUnlock read unlock RUnlock(key interface{}) }
func NewKeyLockeGrp ¶ added in v0.8.9
NewKeyLockeGrp new wide key locker group
func NewXHashKeyLockeGrp ¶ added in v0.8.9
NewXHashKeyLockeGrp new wide key locker group
type TKeyLocker ¶ added in v1.2.2
type TKeyLocker[T comparable] struct { // contains filtered or unexported fields }
TKeyLocker global locker based on key
func NewTKeyLockerInstance ¶ added in v1.2.2
func NewTKeyLockerInstance[T comparable]() *TKeyLocker[T]
NewTKeyLockerInstance new key locker instance
func (*TKeyLocker[T]) Locks ¶ added in v1.2.3
func (d *TKeyLocker[T]) Locks(keys []T)
Locks write lock
func (*TKeyLocker[T]) RLocks ¶ added in v1.2.3
func (d *TKeyLocker[T]) RLocks(keys []T)
RLocks read lock
func (*TKeyLocker[T]) RUnlock ¶ added in v1.2.2
func (d *TKeyLocker[T]) RUnlock(key T)
RUnlock read unlock
func (*TKeyLocker[T]) RUnlocks ¶ added in v1.2.3
func (d *TKeyLocker[T]) RUnlocks(keys []T)
RUnlocks read unlock
func (*TKeyLocker[T]) Unlock ¶ added in v1.2.2
func (d *TKeyLocker[T]) Unlock(key T)
Unlock write unlock
func (*TKeyLocker[T]) Unlocks ¶ added in v1.2.3
func (d *TKeyLocker[T]) Unlocks(keys []T)
Unlocks write unlock
type TKeyLockerGrp ¶ added in v1.2.2
type TKeyLockerGrp[T comparable] struct { // contains filtered or unexported fields }
TKeyLockerGrp wide key locker group
func (*TKeyLockerGrp[T]) Lock ¶ added in v1.2.2
func (w *TKeyLockerGrp[T]) Lock(key T)
Lock write lock
func (*TKeyLockerGrp[T]) Locks ¶ added in v1.2.3
func (w *TKeyLockerGrp[T]) Locks(keys []T)
Locks write lock
func (*TKeyLockerGrp[T]) RLock ¶ added in v1.2.2
func (w *TKeyLockerGrp[T]) RLock(key T)
RLock read lock
func (*TKeyLockerGrp[T]) RLocks ¶ added in v1.2.3
func (w *TKeyLockerGrp[T]) RLocks(keys []T)
RLocks read lock
func (*TKeyLockerGrp[T]) RUnlock ¶ added in v1.2.2
func (w *TKeyLockerGrp[T]) RUnlock(key T)
RUnlock read unlock
func (*TKeyLockerGrp[T]) RUnlocks ¶ added in v1.2.3
func (w *TKeyLockerGrp[T]) RUnlocks(keys []T)
RUnlocks read unlock
func (*TKeyLockerGrp[T]) Unlock ¶ added in v1.2.2
func (w *TKeyLockerGrp[T]) Unlock(key T)
Unlock write unlock
func (*TKeyLockerGrp[T]) Unlocks ¶ added in v1.2.3
func (w *TKeyLockerGrp[T]) Unlocks(keys []T)
Unlocks write unlock
type TLocker ¶ added in v1.2.2
type TLocker[T comparable] interface { // Lock write lock Lock(key T) // Unlock write unlock Unlock(key T) // RLock read lock RLock(key T) // RUnlock read unlock RUnlock(key T) // Locks write lock Locks(keys []T) // Unlocks write unlock Unlocks(keys []T) // RLocks read lock RLocks(keys []T) // RUnlocks read unlock RUnlocks(keys []T) }
func NewTKeyLockeGrp ¶ added in v1.2.2
func NewTKeyLockeGrp[T comparable](opts ...remap.Option) TLocker[T]
NewTKeyLockeGrp new wide key locker group
func NewTKeyLocker ¶ added in v1.2.2
func NewTKeyLocker[T comparable]() TLocker[T]
NewTKeyLocker new key locker
func NewTXHashTKeyLockeGrp ¶ added in v1.2.2
func NewTXHashTKeyLockeGrp[T comparable](opts ...remap.Option) TLocker[T]
NewTXHashTKeyLockeGrp new wide key locker group