atomic

package
v3.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool = atomic.Bool

func NewBool

func NewBool(value bool) *Bool

type Duration

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

func NewDuration

func NewDuration(value time.Duration) *Duration

func (*Duration) Add

func (v *Duration) Add(delta time.Duration) time.Duration

func (*Duration) CAS

func (v *Duration) CAS(old, newValue time.Duration) bool

func (*Duration) CompareAndSwap

func (v *Duration) CompareAndSwap(old, newValue time.Duration) bool

func (*Duration) Load

func (v *Duration) Load() time.Duration

func (*Duration) MarshalJSON

func (v *Duration) MarshalJSON() ([]byte, error)

func (*Duration) Store

func (v *Duration) Store(value time.Duration)

func (*Duration) Sub

func (v *Duration) Sub(delta time.Duration) time.Duration

func (*Duration) Swap

func (v *Duration) Swap(value time.Duration) time.Duration

func (*Duration) UnmarshalJSON

func (v *Duration) UnmarshalJSON(data []byte) error

type Float64

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

func NewFloat64

func NewFloat64(value float64) *Float64

func (*Float64) Add

func (v *Float64) Add(delta float64) float64

func (*Float64) CAS

func (v *Float64) CAS(old, newValue float64) bool

func (*Float64) CompareAndSwap

func (v *Float64) CompareAndSwap(old, newValue float64) bool

func (*Float64) Load

func (v *Float64) Load() float64

func (*Float64) MarshalJSON

func (v *Float64) MarshalJSON() ([]byte, error)

func (*Float64) Store

func (v *Float64) Store(value float64)

func (*Float64) Sub

func (v *Float64) Sub(delta float64) float64

func (*Float64) Swap

func (v *Float64) Swap(value float64) float64

func (*Float64) UnmarshalJSON

func (v *Float64) UnmarshalJSON(data []byte) error

type Int32

type Int32 = atomic.Int32

func NewInt32

func NewInt32(value int32) *Int32

type Int64

type Int64 = atomic.Int64

func NewInt64

func NewInt64(value int64) *Int64

type Pointer

type Pointer[T any] = atomic.Pointer[T]

type Time

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

func NewTime

func NewTime(value time.Time) *Time

func (*Time) Load

func (v *Time) Load() time.Time

func (*Time) MarshalJSON

func (v *Time) MarshalJSON() ([]byte, error)

func (*Time) Store

func (v *Time) Store(value time.Time)

func (*Time) UnmarshalJSON

func (v *Time) UnmarshalJSON(data []byte) error

type Uint32

type Uint32 = atomic.Uint32

func NewUint32

func NewUint32(value uint32) *Uint32

type Uint64

type Uint64 = atomic.Uint64

func NewUint64

func NewUint64(value uint64) *Uint64

type UnsafePointer

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

func NewUnsafePointer

func NewUnsafePointer(value unsafe.Pointer) *UnsafePointer

func (*UnsafePointer) CompareAndSwap

func (v *UnsafePointer) CompareAndSwap(old, newValue unsafe.Pointer) bool

func (*UnsafePointer) Load

func (v *UnsafePointer) Load() unsafe.Pointer

func (*UnsafePointer) Store

func (v *UnsafePointer) Store(value unsafe.Pointer)

func (*UnsafePointer) Swap

func (v *UnsafePointer) Swap(value unsafe.Pointer) unsafe.Pointer

type Value

type Value = atomic.Value

Jump to

Keyboard shortcuts

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