Documentation ¶
Index ¶
- type Array
- type Bool
- type Int
- func (ai *Int) AddAndGet(delta int) int
- func (ai *Int) CompareAndSet(expect int, update int) bool
- func (ai *Int) DecrementAndGet() int
- func (ai *Int) Get() int
- func (ai *Int) GetAndAdd(delta int) int
- func (ai *Int) GetAndDecrement() int
- func (ai *Int) GetAndIncrement() int
- func (ai *Int) GetAndSet(newValue int) int
- func (ai *Int) IncrementAndGet() int
- func (ai *Int) Set(newValue int)
- type Queue
- type SyncVal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
Array implement a fixed width array with atomic semantics
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
Bool implements a synchronized boolean value
func (*Bool) CompareAndToggle ¶
CompareAndToggle atomically sets the boolean value if the current value is equal to updated value.
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int implements an int value with atomic semantics
func (*Int) CompareAndSet ¶
CompareAndSet atomically sets the value to the given updated value if the current value == expected value. Returns true if the expectation was met
func (*Int) DecrementAndGet ¶
DecrementAndGet atomically decrements current value by one and returns the result.
func (*Int) GetAndAdd ¶
GetAndAdd atomically adds the given delta to the current value and returns the result.
func (*Int) GetAndDecrement ¶
GetAndDecrement atomically decrements the current value by one and returns the result.
func (*Int) GetAndIncrement ¶
GetAndIncrement atomically increments current value by one and returns the result.
func (*Int) GetAndSet ¶
GetAndSet atomically sets current value to the given value and returns the old value.
func (*Int) IncrementAndGet ¶
IncrementAndGet atomically increments current value by one and returns the result.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is a non-blocking FIFO queue. If the queue is empty, nil is returned. if the queue is full, offer will return false
type SyncVal ¶
type SyncVal struct {
// contains filtered or unexported fields
}
SyncVal allows synchronized access to a value
func NewSyncVal ¶
func NewSyncVal(val interface{}) *SyncVal
NewSyncVal creates a new instance of SyncVal
func (*SyncVal) GetSyncedVia ¶
GetSyncedVia returns the value returned by the function f.