Documentation
¶
Index ¶
- type AtomicBool
- type AtomicFloat32
- type AtomicFloat64
- type AtomicInt32
- func (i *AtomicInt32) Add(n int32) int32
- func (i *AtomicInt32) CAS(old, new int32) bool
- func (i *AtomicInt32) Dec() int32
- func (i *AtomicInt32) Inc() int32
- func (i *AtomicInt32) Load() int32
- func (i *AtomicInt32) Store(n int32)
- func (i *AtomicInt32) Sub(n int32) int32
- func (i *AtomicInt32) Swap(n int32) int32
- type AtomicInt64
- func (i *AtomicInt64) Add(n int64) int64
- func (i *AtomicInt64) CAS(old, new int64) bool
- func (i *AtomicInt64) Dec() int64
- func (i *AtomicInt64) Inc() int64
- func (i *AtomicInt64) Load() int64
- func (i *AtomicInt64) Store(n int64)
- func (i *AtomicInt64) Sub(n int64) int64
- func (i *AtomicInt64) Swap(n int64) int64
- type AtomicString
- type AtomicUint32
- func (i *AtomicUint32) Add(n uint32) uint32
- func (i *AtomicUint32) CAS(old, new uint32) bool
- func (i *AtomicUint32) Dec() uint32
- func (i *AtomicUint32) Inc() uint32
- func (i *AtomicUint32) Load() uint32
- func (i *AtomicUint32) Store(n uint32)
- func (i *AtomicUint32) Sub(n uint32) uint32
- func (i *AtomicUint32) Swap(n uint32) uint32
- type AtomicUint64
- func (i *AtomicUint64) Add(n uint64) uint64
- func (i *AtomicUint64) CAS(old, new uint64) bool
- func (i *AtomicUint64) Dec() uint64
- func (i *AtomicUint64) Inc() uint64
- func (i *AtomicUint64) Load() uint64
- func (i *AtomicUint64) Store(n uint64)
- func (i *AtomicUint64) Sub(n uint64) uint64
- func (i *AtomicUint64) Swap(n uint64) uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicBool ¶
type AtomicBool struct {
// contains filtered or unexported fields
}
AtomicBool is an atomic Boolean.
func NewAtomicBool ¶
func NewAtomicBool(initial bool) *AtomicBool
NewAtomicBool creates a AtomicBool.
func (*AtomicBool) CAS ¶
func (b *AtomicBool) CAS(old, new bool) bool
CAS is an atomic compare-and-swap.
func (*AtomicBool) Store ¶
func (b *AtomicBool) Store(new bool)
Store atomically stores the passed value.
func (*AtomicBool) Swap ¶
func (b *AtomicBool) Swap(new bool) bool
Swap sets the given value and returns the previous value.
func (*AtomicBool) Toggle ¶
func (b *AtomicBool) Toggle() bool
Toggle atomically negates the Boolean and returns the previous value.
type AtomicFloat32 ¶
type AtomicFloat32 struct {
// contains filtered or unexported fields
}
AtomicFloat32 is an atomic wrapper around float32.
func NewAtomicFloat32 ¶
func NewAtomicFloat32(f float32) *AtomicFloat32
NewAtomicFloat32 creates a AtomicFloat32.
func (*AtomicFloat32) Add ¶
func (f *AtomicFloat32) Add(s float32) float32
Add atomically adds to the wrapped float32 and returns the new value.
func (*AtomicFloat32) CAS ¶
func (f *AtomicFloat32) CAS(old, new float32) bool
CAS is an atomic compare-and-swap.
func (*AtomicFloat32) Load ¶
func (f *AtomicFloat32) Load() float32
Load atomically loads the wrapped value.
func (*AtomicFloat32) Store ¶
func (f *AtomicFloat32) Store(s float32)
Store atomically stores the passed value.
func (*AtomicFloat32) Sub ¶
func (f *AtomicFloat32) Sub(s float32) float32
Sub atomically subtracts from the wrapped float32 and returns the new value.
type AtomicFloat64 ¶
type AtomicFloat64 struct {
// contains filtered or unexported fields
}
AtomicFloat64 is an atomic wrapper around float64.
func NewAtomicFloat64 ¶
func NewAtomicFloat64(f float64) *AtomicFloat64
NewAtomicFloat64 creates a AtomicFloat64.
func (*AtomicFloat64) Add ¶
func (f *AtomicFloat64) Add(s float64) float64
Add atomically adds to the wrapped float64 and returns the new value.
func (*AtomicFloat64) CAS ¶
func (f *AtomicFloat64) CAS(old, new float64) bool
CAS is an atomic compare-and-swap.
func (*AtomicFloat64) Load ¶
func (f *AtomicFloat64) Load() float64
Load atomically loads the wrapped value.
func (*AtomicFloat64) Store ¶
func (f *AtomicFloat64) Store(s float64)
Store atomically stores the passed value.
func (*AtomicFloat64) Sub ¶
func (f *AtomicFloat64) Sub(s float64) float64
Sub atomically subtracts from the wrapped float64 and returns the new value.
type AtomicInt32 ¶
type AtomicInt32 struct {
// contains filtered or unexported fields
}
AtomicInt32 is an atomic wrapper around an int32.
func NewAtomicInt32 ¶
func NewAtomicInt32(i int32) *AtomicInt32
NewAtomicInt32 creates an AtomicInt32.
func (*AtomicInt32) Add ¶
func (i *AtomicInt32) Add(n int32) int32
Add atomically adds to the wrapped int32 and returns the new value.
func (*AtomicInt32) CAS ¶
func (i *AtomicInt32) CAS(old, new int32) bool
CAS is an atomic compare-and-swap.
func (*AtomicInt32) Dec ¶
func (i *AtomicInt32) Dec() int32
Dec atomically decrements the wrapped int32 and returns the new value.
func (*AtomicInt32) Inc ¶
func (i *AtomicInt32) Inc() int32
Inc atomically increments the wrapped int32 and returns the new value.
func (*AtomicInt32) Load ¶
func (i *AtomicInt32) Load() int32
Load atomically loads the wrapped value.
func (*AtomicInt32) Store ¶
func (i *AtomicInt32) Store(n int32)
Store atomically stores the passed value.
func (*AtomicInt32) Sub ¶
func (i *AtomicInt32) Sub(n int32) int32
Sub atomically subtracts from the wrapped int32 and returns the new value.
func (*AtomicInt32) Swap ¶
func (i *AtomicInt32) Swap(n int32) int32
Swap atomically swaps the wrapped int32 and returns the old value.
type AtomicInt64 ¶
type AtomicInt64 struct {
// contains filtered or unexported fields
}
AtomicInt64 is an atomic wrapper around an int64.
func NewAtomicInt64 ¶
func NewAtomicInt64(i int64) *AtomicInt64
NewAtomicInt64 creates an AtomicInt64.
func (*AtomicInt64) Add ¶
func (i *AtomicInt64) Add(n int64) int64
Add atomically adds to the wrapped int64 and returns the new value.
func (*AtomicInt64) CAS ¶
func (i *AtomicInt64) CAS(old, new int64) bool
CAS is an atomic compare-and-swap.
func (*AtomicInt64) Dec ¶
func (i *AtomicInt64) Dec() int64
Dec atomically decrements the wrapped int64 and returns the new value.
func (*AtomicInt64) Inc ¶
func (i *AtomicInt64) Inc() int64
Inc atomically increments the wrapped int64 and returns the new value.
func (*AtomicInt64) Load ¶
func (i *AtomicInt64) Load() int64
Load atomically loads the wrapped value.
func (*AtomicInt64) Store ¶
func (i *AtomicInt64) Store(n int64)
Store atomically stores the passed value.
func (*AtomicInt64) Sub ¶
func (i *AtomicInt64) Sub(n int64) int64
Sub atomically subtracts from the wrapped int64 and returns the new value.
func (*AtomicInt64) Swap ¶
func (i *AtomicInt64) Swap(n int64) int64
Swap atomically swaps the wrapped int64 and returns the old value.
type AtomicString ¶
type AtomicString struct {
// contains filtered or unexported fields
}
func NewAtomicString ¶
func NewAtomicString(str string) *AtomicString
func (*AtomicString) Load ¶
func (s *AtomicString) Load() string
func (*AtomicString) Store ¶
func (s *AtomicString) Store(str string)
type AtomicUint32 ¶
type AtomicUint32 struct {
// contains filtered or unexported fields
}
AtomicUint32 is an atomic wrapper around an uint32.
func NewAtomicUint32 ¶
func NewAtomicUint32(i uint32) *AtomicUint32
NewAtomicUint32 creates a AtomicUint32.
func (*AtomicUint32) Add ¶
func (i *AtomicUint32) Add(n uint32) uint32
Add atomically adds to the wrapped uint32 and returns the new value.
func (*AtomicUint32) CAS ¶
func (i *AtomicUint32) CAS(old, new uint32) bool
CAS is an atomic compare-and-swap.
func (*AtomicUint32) Dec ¶
func (i *AtomicUint32) Dec() uint32
Dec atomically decrements the wrapped int32 and returns the new value.
func (*AtomicUint32) Inc ¶
func (i *AtomicUint32) Inc() uint32
Inc atomically increments the wrapped uint32 and returns the new value.
func (*AtomicUint32) Load ¶
func (i *AtomicUint32) Load() uint32
Load atomically loads the wrapped value.
func (*AtomicUint32) Store ¶
func (i *AtomicUint32) Store(n uint32)
Store atomically stores the passed value.
func (*AtomicUint32) Sub ¶
func (i *AtomicUint32) Sub(n uint32) uint32
Sub atomically subtracts from the wrapped uint32 and returns the new value.
func (*AtomicUint32) Swap ¶
func (i *AtomicUint32) Swap(n uint32) uint32
Swap atomically swaps the wrapped uint32 and returns the old value.
type AtomicUint64 ¶
type AtomicUint64 struct {
// contains filtered or unexported fields
}
AtomicUint64 is an atomic wrapper around a uint64.
func NewAtomicUint64 ¶
func NewAtomicUint64(i uint64) *AtomicUint64
NewAtomicUint64 creates a AtomicUint64.
func (*AtomicUint64) Add ¶
func (i *AtomicUint64) Add(n uint64) uint64
Add atomically adds to the wrapped uint64 and returns the new value.
func (*AtomicUint64) CAS ¶
func (i *AtomicUint64) CAS(old, new uint64) bool
CAS is an atomic compare-and-swap.
func (*AtomicUint64) Dec ¶
func (i *AtomicUint64) Dec() uint64
Dec atomically decrements the wrapped uint64 and returns the new value.
func (*AtomicUint64) Inc ¶
func (i *AtomicUint64) Inc() uint64
Inc atomically increments the wrapped uint64 and returns the new value.
func (*AtomicUint64) Load ¶
func (i *AtomicUint64) Load() uint64
Load atomically loads the wrapped value.
func (*AtomicUint64) Store ¶
func (i *AtomicUint64) Store(n uint64)
Store atomically stores the passed value.
func (*AtomicUint64) Sub ¶
func (i *AtomicUint64) Sub(n uint64) uint64
Sub atomically subtracts from the wrapped uint64 and returns the new value.
func (*AtomicUint64) Swap ¶
func (i *AtomicUint64) Swap(n uint64) uint64
Swap atomically swaps the wrapped uint64 and returns the old value.