Documentation ¶
Overview ¶
Package gxatomic provides simple wrappers around numerics to enforce atomic access.
Example ¶
// Uint32 is a thin wrapper around the primitive uint32 type. var atom Uint32 // The wrapper ensures that all operations are atomic. atom.Store(42) fmt.Println(atom.Inc()) fmt.Println(atom.CAS(43, 0)) fmt.Println(atom.Load())
Output: 43 true 0
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
Bool is an atomic Boolean.
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
Duration is an atomic wrapper around time.Duration https://godoc.org/time#Duration
type Float64 ¶
type Float64 struct {
// contains filtered or unexported fields
}
Float64 is an atomic wrapper around float64.
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
Int32 is an atomic wrapper around an int32.
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
Int64 is an atomic wrapper around an int64.
type String ¶
type String struct {
// contains filtered or unexported fields
}
String is an atomic type-safe wrapper around Value for strings.
type Uint32 ¶
type Uint32 struct {
// contains filtered or unexported fields
}
Uint32 is an atomic wrapper around an uint32.
type Uint64 ¶
type Uint64 struct {
// contains filtered or unexported fields
}
Uint64 is an atomic wrapper around a uint64.
type Value ¶
Value shadows the type of the same name from sync/atomic https://godoc.org/sync/atomic#Value
Click to show internal directories.
Click to hide internal directories.