atomic

package
v0.0.0-...-4646cf5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Float64

type Float64 struct {
	// contains filtered or unexported fields
}

Float64 is an atomic wrapper around float64.

func NewFloat

func NewFloat(f float64) *Float64

NewFloat creates a Float64.

func (*Float64) Add

func (f *Float64) Add(s float64) float64

Add atomically adds to the wrapped float64 and returns the new value.

func (*Float64) CAS

func (f *Float64) CAS(old, new float64) bool

CAS is an atomic compare-and-swap.

func (*Float64) Load

func (f *Float64) Load() float64

Load atomically loads the wrapped value.

func (*Float64) Store

func (f *Float64) Store(s float64)

Store atomically stores the passed value.

func (*Float64) Sub

func (f *Float64) Sub(s float64) float64

Sub atomically subtracts from the wrapped float64 and returns the new value.

func (*Float64) Swap

func (f *Float64) Swap(s float64) (old float64)

Swap atomically swaps the passed value and returns the old one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL