atomic

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 1 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

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

func New

func New(b bool) *Bool

func (*Bool) CompareAndSwap

func (a *Bool) CompareAndSwap(old, new bool) bool

func (*Bool) Get

func (a *Bool) Get() bool

func (*Bool) Set

func (a *Bool) Set(b bool) bool

type Int32

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

Int32 提供原子操作

func (*Int32) Add

func (a *Int32) Add(i int32) int32

Add 计数增加 i ,返回新值。 减操作:Add(-1)

func (*Int32) CompareAndSwap

func (a *Int32) CompareAndSwap(old, new int32) bool

func (*Int32) Get

func (a *Int32) Get() int32

Get 获取值

func (*Int32) Swap

func (a *Int32) Swap(i int32) int32

Swap 交换值,并返回原来的值

type Int64

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

Int64 提供原子操作

func (*Int64) Add

func (a *Int64) Add(i int64) int64

Add 计数增加 i,返回新值。 减操作:Add(-1)

func (*Int64) CompareAndSwap

func (a *Int64) CompareAndSwap(old, new int64) bool

func (*Int64) Get

func (a *Int64) Get() int64

Get 获取值

func (*Int64) Swap

func (a *Int64) Swap(i int64) int64

Swap 交换值,并返回原来的值

Jump to

Keyboard shortcuts

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