package seqatomic
import "gvisor.dev/gvisor/pkg/sync/atomicptr"
Package seqatomic doesn't exist. This file must be instantiated using the go_template_instance rule in tools/go_generics/defs.bzl.
Index ¶
- type AtomicPtr
- func (p *AtomicPtr) Load() *Value
- func (p *AtomicPtr) Store(x *Value)
- func (p *AtomicPtr) Swap(x *Value) *Value
- type Value
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 ¶
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 ¶
Store sets the value returned by Load to x.
func (*AtomicPtr) Swap ¶
Swap atomically stores `x` into *p and returns the previous *p value.
type Value ¶
type Value struct{}
Value is a required type parameter.
Source Files ¶
generic_atomicptr_unsafe.go
- Version
- v0.0.0-20250508033829-06acafc42203 (latest)
- Published
- May 8, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 7 hours ago –
Tools for package owners.