xatomic

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package xatomic contains extensions to the standard library package sync/atomic.

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 is equivalent to sync/atomic.Value, except strongly typed.

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(t 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