Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MutexMap ¶
type MutexMap[K comparable] struct { // contains filtered or unexported fields }
MutexMap is a map of mutexes by a given key type [K].
The map keeps track of entities trying to lock a certain key. Upon releasing a key, if no entity wants to lock a key, the key is deleted from the map, keeping it as small as possible.
func NewMutexMap ¶
func NewMutexMap[K comparable]() *MutexMap[K]
NewMutexMap creates a new MutexMap.
func (*MutexMap[K]) Count ¶
Count returns the number of locking entities for a given key. If a key is not present, 0 is returned.
Click to show internal directories.
Click to hide internal directories.