atomic

package standard library
go1.24.11 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package atomic provides atomic operations, independent of sync/atomic, to the runtime.

On most platforms, the compiler is aware of the functions defined in this package, and they're replaced with platform-specific intrinsics. On other platforms, generic implementations are made available.

Unless otherwise noted, operations defined in this package are sequentially consistent across threads with respect to the values they manipulate. More specifically, operations that happen in a specific order on one thread, will always be observed to happen in exactly that order by another thread.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And(ptr *uint32, val uint32)

func And8

func And8(ptr *uint8, val uint8)

func And32

func And32(ptr *uint32, val uint32) uint32

func And64

func And64(ptr *uint64, val uint64) uint64

func Anduintptr

func Anduintptr(ptr *uintptr, val uintptr) uintptr

func Cas

func Cas(ptr *uint32, old, new uint32) bool

func Cas64

func Cas64(ptr *uint64, old, new uint64) bool

func CasRel

func CasRel(ptr *uint32, old, new uint32) bool

func Casint32

func Casint32(ptr *int32, old, new int32) bool

func Casint64

func Casint64(ptr *int64, old, new int64) bool

func Casp1

func Casp1(ptr *unsafe.Pointer, old, new unsafe.Pointer) bool

NO go:noescape annotation; see atomic_pointer.go.

func Casuintptr

func Casuintptr(ptr *uintptr, old, new uintptr) bool

func Load

func Load(ptr *uint32) uint32

func Load8

func Load8(ptr *uint8) uint8

func Load64

func Load64(ptr *uint64) uint64

func LoadAcq

func LoadAcq(ptr *uint32) uint32

func LoadAcq64

func LoadAcq64(ptr *uint64) uint64

func LoadAcquintptr

func LoadAcquintptr(ptr *uintptr) uintptr

func Loadint32

func Loadint32(ptr *int32) int32

func Loadint64

func Loadint64(ptr *int64) int64

func Loadp

func Loadp(ptr unsafe.Pointer) unsafe.Pointer

func Loaduint

func Loaduint(ptr *uint) uint

func Loaduintptr

func Loaduintptr(ptr *uintptr) uintptr

func Or

func Or(ptr *uint32, val uint32)

func Or8

func Or8(ptr *uint8, val uint8)

func Or32

func Or32(ptr *uint32, val uint32) uint32

func Or64

func Or64(ptr *uint64, val uint64) uint64

func