concurrenz

package
v0.17.31 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicBitSet added in v0.15.21

type AtomicBitSet uint32

func (*AtomicBitSet) CompareAndSet added in v0.15.21

func (self *AtomicBitSet) CompareAndSet(index int, current, next bool) bool

func (*AtomicBitSet) CompareAndSetAll added in v0.15.21

func (self *AtomicBitSet) CompareAndSetAll(current, next uint32) bool

func (*AtomicBitSet) IsSet added in v0.15.21

func (self *AtomicBitSet) IsSet(index int) bool

func (*AtomicBitSet) Load added in v0.15.21

func (self *AtomicBitSet) Load() uint32

func (*AtomicBitSet) Set added in v0.15.21

func (self *AtomicBitSet) Set(index int, val bool)

func (*AtomicBitSet) Store added in v0.15.21

func (self *AtomicBitSet) Store(val uint32)

type AtomicBoolean

type AtomicBoolean int32

func (*AtomicBoolean) CompareAndSwap

func (ab *AtomicBoolean) CompareAndSwap(expected, val bool) bool

CompareAndSwap sets the given value only if the current value is equal to expected. return true if the swap was made

func (*AtomicBoolean) Get

func (ab *AtomicBoolean) Get() bool

func (*AtomicBoolean) GetUnsafe

func (ab *AtomicBoolean) GetUnsafe() bool

GetUnsafe returns the value if you are sure you are getting from the same thread as the last set This is only useful if you only set from one goroutine and are only using Get to sync access across other threads. GetUnsafe can then be used from the Set goroutine

func (*AtomicBoolean) Set

func (ab *AtomicBoolean) Set(val bool)

func (*AtomicBoolean) WaitForState

func (ab *AtomicBoolean) WaitForState(val bool, timeout time.Duration, pollInterval time.Duration) error

type AtomicString

type AtomicString atomic.Value

func (*AtomicString) Get

func (ab *AtomicString) Get() string

func (*AtomicString) Set

func (ab *AtomicString) Set(val string)

type AtomicValue added in v0.17.23

type AtomicValue[T any] atomic.Value

func (*AtomicValue[T]) Load added in v0.17.23

func (self *AtomicValue[T]) Load() T

func (*AtomicValue[T]) Store added in v0.17.23

func (self *AtomicValue[T]) Store(val T)

type CopyOnWriteMap added in v0.17.23

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

func (*CopyOnWriteMap[K, V]) AsMap added in v0.17.23

func (self *CopyOnWriteMap[K, V]) AsMap() map[K]V

func (*CopyOnWriteMap[K, V]) Clear added in v0.17.23

func (self *CopyOnWriteMap[K, V]) Clear()

func (*CopyOnWriteMap[K, V]) Get added in v0.17.23

func (self *CopyOnWriteMap[K, V]) Get(key K) V

func (*CopyOnWriteMap[K, V]) Put added in v0.17.23

func (self *CopyOnWriteMap[K, V]) Put(key K, value V)

type CopyOnWriteSlice added in v0.17.23

type CopyOnWriteSlice[T any] struct {
	// contains filtered or unexported fields
}

func (*CopyOnWriteSlice[T]) Append added in v0.17.23

func (self *CopyOnWriteSlice[T]) Append(toAdd T)

func (*CopyOnWriteSlice[T]) Delete added in v0.17.23

func (self *CopyOnWriteSlice[T]) Delete(toRemove T)

func (*CopyOnWriteSlice[T]) Value added in v0.17.23

func (self *CopyOnWriteSlice[T]) Value() []T

type RefCount added in v0.16.18

type RefCount int32

func (*RefCount) DecrRefCount added in v0.16.18

func (self *RefCount) DecrRefCount() int32

func (*RefCount) IncrRefCount added in v0.16.18

func (self *RefCount) IncrRefCount() int32

type Semaphore added in v0.17.8

type Semaphore interface {
	Acquire()
	AcquireWithTimeout(t time.Duration) bool
	TryAcquire() bool
	Release() bool
}

func NewSemaphore added in v0.17.8

func NewSemaphore(size int) Semaphore

type WaitGroup added in v0.16.9

type WaitGroup interface {
	// AddNotifier adds a notifier to the wait group
	AddNotifier(ch <-chan struct{})

	// WaitForDone will wait for all notifiers to complete up to the given deadline. It will return false if the timeout
	//             was reached, true otherwise
	WaitForDone(timeout time.Duration) bool
}

WaitGroup provides a facility to wait for an arbitrarily size collection of notification channels to be completed

The methods are multi-thread safe, but notifiers added after WaitForDone has been called are not guaranteed
to be waited for

func NewWaitGroup added in v0.16.9

func NewWaitGroup() WaitGroup

Jump to

Keyboard shortcuts

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