sync

package module
v0.0.0-...-9365f71 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnceFunc

func OnceFunc(fn func()) func()

func OnceValue

func OnceValue[T interface{}](fn func() T) func() T

func OnceValues

func OnceValues[T1, T2 interface{}](fn func() (T1, T2)) func() (T1, T2)

func Zero

func Zero[T interface{}]() (zero T)

Types

type KV

type KV[K comparable, V interface{}] = channel.KV[K, V]

type Locker

type Locker = sync.Locker

type Map

type Map[K comparable, V interface{}] struct {
	// contains filtered or unexported fields
}

func (*Map[K, V]) Clear

func (maps *Map[K, V]) Clear()

func (*Map[K, V]) CompareAndDelete

func (maps *Map[K, V]) CompareAndDelete(key K, value V) bool

func (*Map[K, V]) CompareAndSwap

func (maps *Map[K, V]) CompareAndSwap(key K, old, new V) bool

func (*Map[K, V]) Delete

func (maps *Map[K, V]) Delete(key K)

func (*Map[K, V]) Load

func (maps *Map[K, V]) Load(key K) (V, bool)

func (*Map[K, V]) LoadAndDelete

func (maps *Map[K, V]) LoadAndDelete(key K) (V, bool)

func (*Map[K, V]) LoadOrStore

func (maps *Map[K, V]) LoadOrStore(key K, value V) (V, bool)

func (*Map[K, V]) Map

func (maps *Map[K, V]) Map() map[K]V

func (*Map[K, V]) Range

func (maps *Map[K, V]) Range(fn func(K, V) bool)

func (*Map[K, V]) Store

func (maps *Map[K, V]) Store(key K, value V)

func (*Map[K, V]) Swap

func (maps *Map[K, V]) Swap(key K, value V) (V, bool)

type MapChan

type MapChan[K comparable, V interface{}] struct {
	Map[K, V]
	channel.Manager[*channel.KV[K, V]]
}

func (*MapChan[K, V]) Sender

func (mc *MapChan[K, V]) Sender() chan<- *channel.KV[K, V]

type Mutex

type Mutex = sync.Mutex

type Once

type Once[T interface{}] struct {
	// contains filtered or unexported fields
}

func (*Once[T]) Do

func (once *Once[T]) Do(fn T) interface{}

type Pool

type Pool[T interface{}] struct {
	New func() T
	// contains filtered or unexported fields
}

func (*Pool[T]) Get

func (pool *Pool[T]) Get() T

func (*Pool[T]) Put

func (pool *Pool[T]) Put(t T)

type PoolChan

type PoolChan[T interface{}] struct {
	Pool[T]
	channel.Manager[T]
}

func (*PoolChan[T]) Sender

func (pc *PoolChan[T]) Sender() chan<- T

type RWMutex

type RWMutex = sync.RWMutex

type Slice

type Slice[T interface{}] struct {
	// contains filtered or unexported fields
}

func (*Slice[T]) Append

func (slice *Slice[T]) Append(v ...T)

func (*Slice[T]) Cap

func (slice *Slice[T]) Cap() int

func (*Slice[T]) Delete

func (slice *Slice[T]) Delete(i int)

func (*Slice[T]) Index

func (slice *Slice[T]) Index(i int) T

func (*Slice[T]) Len

func (slice *Slice[T]) Len() int

func (*Slice[T]) Range

func (slice *Slice[T]) Range(fn func(int, T) bool)

func (*Slice[T]) Slice

func (slice *Slice[T]) Slice() []T

type SliceChan

type SliceChan[T interface{}] struct {
	Slice[T]
	channel.Manager[T]
}

func (*SliceChan[T]) Sender

func (sc *SliceChan[T]) Sender() chan<- T

type Wait

type Wait struct {
	// contains filtered or unexported fields
}

func (*Wait) C

func (wait *Wait) C() <-chan bool

func (*Wait) Done

func (wait *Wait) Done()

func (*Wait) Wait

func (wait *Wait) Wait()

type WaitGroup

type WaitGroup = sync.WaitGroup

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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