syncutils

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: Apache-2.0, BSD-2-Clause Imports: 2 Imported by: 0

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

func (*KRWMutex) Free

func (kwrMutex *KRWMutex) Free(key interface{})

func (*KRWMutex) Register

func (krwMutex *KRWMutex) Register(key interface{}) (result *RWMutex)

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 Mutex

type Mutex = sync.Mutex

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{})

type RWMutex

type RWMutex = sync.RWMutex

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL