Documentation ¶
Overview ¶
Package atomic provides simple wrappers around numerics to enforce atomic access.
Package atomic provides simple wrappers around numerics to enforce atomic access.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Example ¶
package main import ( "fmt" "github.com/NVIDIA/aistore/3rdparty/atomic" ) func main() { // Uint32 is a thin wrapper around the primitive uint32 type. var atom atomic.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.
func (*Bool) MarshalJSON ¶
func (*Bool) UnmarshalJSON ¶
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
Duration is an atomic wrapper around time.Duration https://godoc.org/time#Duration
type Float32 ¶
type Float32 struct {
// contains filtered or unexported fields
}
Float32 is an atomic wrapper around float32.
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 Pointer ¶
type Pointer struct {
// contains filtered or unexported fields
}
Pointer is an atomic wrapper around unsafe.Pointer https://godoc.org/unsafe#Pointer
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time is an atomic wrapper around time.Time https://godoc.org/time#Time
func (*Time) MarshalJSON ¶
func (*Time) UnmarshalJSON ¶
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