package
Version:
v0.0.0-...-d88c8b5
Opens a new window with list of versions in this module.
Published: Feb 9, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package atomic provides simple wrappers around numerics to enforce atomic
access.
Bool is an atomic Boolean.
CAS is an atomic compare-and-swap.
Load atomically loads the Boolean.
Store atomically stores the passed value.
Swap sets the given value and returns the previous value.
Toggle atomically negates the Boolean and returns the previous value.
Duration is an atomic wrapper around time.Duration
https://godoc.org/time#Duration
NewDuration creates a Duration.
Add atomically adds to the wrapped time.Duration and returns the new value.
CAS is an atomic compare-and-swap.
Load atomically loads the wrapped value.
Store atomically stores the passed value.
Sub atomically subtracts from the wrapped time.Duration and returns the new value.
Swap atomically swaps the wrapped time.Duration and returns the old value.
Float64 is an atomic wrapper around float64.
NewFloat64 creates a Float64.
Add atomically adds to the wrapped float64 and returns the new value.
CAS is an atomic compare-and-swap.
Load atomically loads the wrapped value.
Store atomically stores the passed value.
Sub atomically subtracts from the wrapped float64 and returns the new value.
Int32 is an atomic wrapper around an int32.
NewInt32 creates an Int32.
Add atomically adds to the wrapped int32 and returns the new value.
CAS is an atomic compare-and-swap.
Dec atomically decrements the wrapped int32 and returns the new value.
Inc atomically increments the wrapped int32 and returns the new value.
Load atomically loads the wrapped value.
Store atomically stores the passed value.
Sub atomically subtracts from the wrapped int32 and returns the new value.
Swap atomically swaps the wrapped int32 and returns the old value.
Int64 is an atomic wrapper around an int64.
NewInt64 creates an Int64.
Add atomically adds to the wrapped int64 and returns the new value.
CAS is an atomic compare-and-swap.
Dec atomically decrements the wrapped int64 and returns the new value.
Inc atomically increments the wrapped int64 and returns the new value.
Load atomically loads the wrapped value.
Store atomically stores the passed value.
Sub atomically subtracts from the wrapped int64 and returns the new value.
Swap atomically swaps the wrapped int64 and returns the old value.
String is an atomic type-safe wrapper around Value for strings.
NewString creates a String.
Load atomically loads the wrapped string.
Store atomically stores the passed string.
Note: Converting the string to an interface{} to store in the Value
requires an allocation.
Uint32 is an atomic wrapper around an uint32.
NewUint32 creates a Uint32.
Add atomically adds to the wrapped uint32 and returns the new value.
CAS is an atomic compare-and-swap.
Dec atomically decrements the wrapped int32 and returns the new value.
Inc atomically increments the wrapped uint32 and returns the new value.
Load atomically loads the wrapped value.
Store atomically stores the passed value.
Sub atomically subtracts from the wrapped uint32 and returns the new value.
Swap atomically swaps the wrapped uint32 and returns the old value.
Uint64 is an atomic wrapper around a uint64.
NewUint64 creates a Uint64.
Add atomically adds to the wrapped uint64 and returns the new value.
CAS is an atomic compare-and-swap.
Dec atomically decrements the wrapped uint64 and returns the new value.
Inc atomically increments the wrapped uint64 and returns the new value.
Load atomically loads the wrapped value.
Store atomically stores the passed value.
Sub atomically subtracts from the wrapped uint64 and returns the new value.
Swap atomically swaps the wrapped uint64 and returns the old value.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.