Documentation
¶
Overview ¶
Package syncx provides additional synchronization mechanisms and utilities.
Index ¶
- type Lock
- type Map
- func (m *Map[K, V]) Delete(key K)
- func (m *Map[K, V]) Load(key K) (value V, ok bool)
- func (m *Map[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (m *Map[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (m *Map[K, V]) Range(f func(key K, value V) bool)
- func (m *Map[K, V]) Store(key K, value V)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lock ¶
type Lock chan struct{}
Lock is a mutually exclusive lock that supports cancelling acquire operation.
func NewLock ¶
func NewLock() Lock
NewLock returns a new Lock that allows at most one goroutine to acquire it.
type Map ¶
Map is a type-safe wrapper for sync.Map.
func (*Map[K, V]) Delete ¶
func (m *Map[K, V]) Delete(key K)
Delete is a type-safe wrapper for sync.Map’s Delete method.
func (*Map[K, V]) LoadAndDelete ¶
LoadAndDelete is a type-safe wrapper for sync.Map’s LoadAndDelete method.
func (*Map[K, V]) LoadOrStore ¶
LoadOrStore is a type-safe wrapper for sync.Map’s LoadOrStore method.
Click to show internal directories.
Click to hide internal directories.