package atomic
import "github.com/uber/tchannel-go/atomic"
Package atomic provides simple wrappers around numerics to enforce atomic access.
Index ¶
- type Int32
- func NewInt32(i int32) *Int32
- func (i *Int32) Add(n int32) int32
- func (i *Int32) CAS(old, new int32) bool
- func (i *Int32) Dec() int32
- func (i *Int32) Inc() int32
- func (i *Int32) Load() int32
- func (i *Int32) Store(n int32)
- func (i *Int32) Swap(n int32) int32
- type Int64
- func NewInt64(i int64) *Int64
- func (i *Int64) Add(n int64) int64
- func (i *Int64) CAS(old, new int64) bool
- func (i *Int64) Dec() int64
- func (i *Int64) Inc() int64
- func (i *Int64) Load() int64
- func (i *Int64) Store(n int64)
- func (i *Int64) Swap(n int64) int64
- type Uint32
- func NewUint32(i uint32) *Uint32
- func (i *Uint32) Add(n uint32) uint32
- func (i *Uint32) CAS(old, new uint32) bool
- func (i *Uint32) Dec() uint32
- func (i *Uint32) Inc() uint32
- func (i *Uint32) Load() uint32
- func (i *Uint32) Store(n uint32)
- func (i *Uint32) Swap(n uint32) uint32
- type Uint64
Types ¶
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
Int32 is an atomic wrapper around an int32.
func NewInt32 ¶
NewInt32 creates an Int32.
func (*Int32) Add ¶
Add atomically adds to the wrapped int32 and returns the new value.
func (*Int32) CAS ¶
CAS is an atomic compare-and-swap.
func (*Int32) Dec ¶
Dec atomically decrements the wrapped int32 and returns the new value.
func (*Int32) Inc ¶
Inc atomically increments the wrapped int32 and returns the new value.
func (*Int32) Load ¶
Load atomically loads the wrapped value.
func (*Int32) Store ¶
Store atomically stores the passed value.
func (*Int32) Swap ¶
Swap atomically swaps the wrapped int32 and returns the old value.
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
Int64 is an atomic wrapper around an int64.
func NewInt64 ¶
NewInt64 creates an Int64.
func (*Int64) Add ¶
Add atomically adds to the wrapped int64 and returns the new value.
func (*Int64) CAS ¶
CAS is an atomic compare-and-swap.
func (*Int64) Dec ¶
Dec atomically decrements the wrapped int64 and returns the new value.
func (*Int64) Inc ¶
Inc atomically increments the wrapped int64 and returns the new value.
func (*Int64) Load ¶
Load atomically loads the wrapped value.
func (*Int64) Store ¶
Store atomically stores the passed value.
func (*Int64) Swap ¶
Swap atomically swaps the wrapped int64 and returns the old value.
type Uint32 ¶
type Uint32 struct {
// contains filtered or unexported fields
}
Uint32 is an atomic wrapper around an uint32.
func NewUint32 ¶
NewUint32 creates a Uint32.
func (*Uint32) Add ¶
Add atomically adds to the wrapped uint32 and returns the new value.
func (*Uint32) CAS ¶
CAS is an atomic compare-and-swap.
func (*Uint32) Dec ¶
Dec atomically decrements the wrapped int32 and returns the new value.
func (*Uint32) Inc ¶
Inc atomically increments the wrapped uint32 and returns the new value.
func (*Uint32) Load ¶
Load atomically loads the wrapped value.
func (*Uint32) Store ¶
Store atomically stores the passed value.
func (*Uint32) Swap ¶
Swap atomically swaps the wrapped uint32 and returns the old value.
type Uint64 ¶
type Uint64 struct {
// contains filtered or unexported fields
}
Uint64 is an atomic wrapper around a uint64.
func NewUint64 ¶
NewUint64 creates a Uint64.
func (*Uint64) Add ¶
Add atomically adds to the wrapped uint64 and returns the new value.
func (*Uint64) CAS ¶
CAS is an atomic compare-and-swap.
func (*Uint64) Dec ¶
Dec atomically decrements the wrapped uint64 and returns the new value.
func (*Uint64) Inc ¶
Inc atomically increments the wrapped uint64 and returns the new value.
func (*Uint64) Load ¶
Load atomically loads the wrapped value.
func (*Uint64) Store ¶
Store atomically stores the passed value.
func (*Uint64) Swap ¶
Swap atomically swaps the wrapped uint64 and returns the old value.
Source Files ¶
- Version
- v1.0.5
- Published
- Apr 4, 2016
- Platform
- js/wasm
- Imports
- 1 packages
- Last checked
- 9 hours ago –
Tools for package owners.