atomicValue

package
v0.0.0-...-cf38f87 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicT

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

AtomicT represents a specialized atomic value, more like sync/atomic.Value with Swap/CompareAndSwap support. Must not be copied.

func NewAtomicT

func NewAtomicT(initial T) *AtomicT

NewAtomicT returns a new atomic value with an initial value.

func (*AtomicT) CompareAndSwap

func (a *AtomicT) CompareAndSwap(fn func(oldV T) (newV T, ok bool)) (ok bool)

func (*AtomicT) Load

func (a *AtomicT) Load() (v T)

func (*AtomicT) Store

func (a *AtomicT) Store(v T)

func (*AtomicT) Swap

func (a *AtomicT) Swap(newV T) (oldV T)

type T

type T interface{}

Jump to

Keyboard shortcuts

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