Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KRWMutex ¶
type KRWMutex struct {
// contains filtered or unexported fields
}
func NewKRWMutex ¶
func NewKRWMutex() *KRWMutex
type LockableEntity ¶
type LockableEntity interface {
// Locks returns the locks that the entity needs to lock.
Locks() (locks []interface{})
}
LockableEntity is an interface that allows to lock (and unlock) entities that are generating complex locks.
type MultiMutex ¶
type MultiMutex struct {
// contains filtered or unexported fields
}
func NewMultiMutex ¶
func NewMultiMutex() *MultiMutex
func (*MultiMutex) Lock ¶
func (mutex *MultiMutex) Lock(identifiers ...interface{})
func (*MultiMutex) LockEntity ¶
func (mutex *MultiMutex) LockEntity(entity LockableEntity)
LockEntity locks all locks that are required for the given LockEntity.
func (*MultiMutex) Unlock ¶
func (mutex *MultiMutex) Unlock(identifiers ...interface{})
func (*MultiMutex) UnlockEntity ¶
func (mutex *MultiMutex) UnlockEntity(entity LockableEntity)
UnlockEntity unlocks all locks that are required for the given LockEntity.
type MultiMutexLockBuilder ¶
type MultiMutexLockBuilder struct {
// contains filtered or unexported fields
}
func (*MultiMutexLockBuilder) AddLock ¶
func (lockBuilder *MultiMutexLockBuilder) AddLock(identifier interface{}) *MultiMutexLockBuilder
func (*MultiMutexLockBuilder) Build ¶
func (lockBuilder *MultiMutexLockBuilder) Build() []interface{}
type RWMultiMutex ¶
type RWMultiMutex struct {
// contains filtered or unexported fields
}
func (*RWMultiMutex) Lock ¶
func (mutex *RWMultiMutex) Lock(identifiers ...interface{})
func (*RWMultiMutex) RLock ¶
func (mutex *RWMultiMutex) RLock(identifiers ...interface{})
func (*RWMultiMutex) RUnlock ¶
func (mutex *RWMultiMutex) RUnlock(identifiers ...interface{})
func (*RWMultiMutex) Unlock ¶
func (mutex *RWMultiMutex) Unlock(identifiers ...interface{})
Click to show internal directories.
Click to hide internal directories.