atomic

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool int32

func (*Bool) IsSet

func (b *Bool) IsSet() bool

func (*Bool) SetFalse

func (b *Bool) SetFalse()

func (*Bool) SetTrue

func (b *Bool) SetTrue()

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