atomic

package
v0.0.0-...-14c233f Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 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 Bool

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

func (*Bool) Get

func (a *Bool) Get() bool

Get:原子判断 a.b 是否为 1

func (*Bool) Set

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

Set:将 a.b 置位为 1

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) 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) 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