atomic

package
v0.0.0-...-8124b04 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Value

type Value[T any] struct {
	// contains filtered or unexported fields
}

Value 是 atomic.Value 的泛型化封装

func (*Value[T]) CompareAndSwap

func (v *Value[T]) CompareAndSwap(old, new T) (swapped bool)

func (*Value[T]) Load

func (v *Value[T]) Load() T

func (*Value[T]) Store

func (v *Value[T]) Store(val T)

func (*Value[T]) Swap

func (v *Value[T]) Swap(new T) (old T)

Jump to

Keyboard shortcuts

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