seqatomic

package
v0.0.0-...-c27c9a0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: Apache-2.0, MIT, BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package seqatomic doesn't exist. This file must be instantiated using the go_template_instance rule in tools/go_generics/defs.bzl.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicPtr

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

An AtomicPtr is a pointer to a value of type Value that can be atomically loaded and stored. The zero value of an AtomicPtr represents nil.

Note that copying AtomicPtr by value performs a non-atomic read of the stored pointer, which is unsafe if Store() can be called concurrently; in this case, do `dst.Store(src.Load())` instead.

+stateify savable

func (*AtomicPtr) Load

func (p *AtomicPtr) Load() *Value

Load returns the value set by the most recent Store. It returns nil if there has been no previous call to Store.

func (*AtomicPtr) Store

func (p *AtomicPtr) Store(x *Value)

Store sets the value returned by Load to x.

func (*AtomicPtr) Swap

func (p *AtomicPtr) Swap(x *Value) *Value

Swap atomically stores `x` into *p and returns the previous *p value.

type Value

type Value struct{}

Value is a required type parameter.

Jump to

Keyboard shortcuts

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