Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockGroup ¶
type LockGroup struct {
// contains filtered or unexported fields
}
LockGroup is a map of mutex that locks entries with different id separately. It's used levitate lock contentions of using a global lock.
func NewLockGroup ¶
func NewLockGroup(options ...LockGroupOption) *LockGroup
NewLockGroup create and return an empty lockGroup.
type LockGroupOption ¶
type LockGroupOption func(lg *LockGroup)
LockGroupOption configures the lock group.
func WithHash ¶
func WithHash(hashFn func(id uint32) uint32) LockGroupOption
WithHash sets the lockGroup's hash function to provided hashFn.
func WithRemoveEntryOnUnlock ¶
func WithRemoveEntryOnUnlock(removeEntryOnUnlock bool) LockGroupOption
WithRemoveEntryOnUnlock sets the lockGroup's removeEntryOnUnlock to provided value.
Click to show internal directories.
Click to hide internal directories.