package
Version:
v0.0.0-...-8124b04
Opens a new window with list of versions in this module.
Published: Dec 10, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Value[T any] struct {
}
Value 是 atomic.Value 的泛型化封装
func (v *Value[T]) CompareAndSwap(old, new T) (swapped bool)
func (v *Value[T]) Load() T
func (v *Value[T]) Store(val T)
func (v *Value[T]) Swap(new T) (old T)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.