atomic

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 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 provides a struct implementing an atomic version of a float64 value, like sync/atomic.Int64

func (*Float64) Add

func (x *Float64) Add(delta float64) (updated float64)

Add atomically adds delta to x and returns the new value.

func (*Float64) CompareAndSwap

func (x *Float64) CompareAndSwap(oldVal, newVal float64) (swapped bool)

CompareAndSwap executes the compare-and-swap operation for x.

func (*Float64) Load

func (x *Float64) Load() float64

Load atomically loads and returns the value stored in x.

func (*Float64) Store

func (x *Float64) Store(val float64)

Store atomically stores val into x.

func (*Float64) Swap

func (x *Float64) Swap(newVal float64) (oldVal float64)

Swap atomically stores new into x and returns the previous value.

type Int32

type Int32 = atomic.Int32

type Int64

type Int64 = atomic.Int64

type Uint32

type Uint32 = atomic.Uint32

type Uint64

type Uint64 = atomic.Uint64

Jump to

Keyboard shortcuts

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