sync

package
v0.0.0-...-1e877d2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const POINT = 10

POINT 自旋当前次数协程让出CPU

Variables

This section is empty.

Functions

func AddInt32

func AddInt32(val, add int32)

AddInt32 CAS增加int32

func AddInt64

func AddInt64(val, add int64)

AddInt64 CAS增加int64

func AddUint32

func AddUint32(val, add uint32)

AddUint32 CAS增加uint32

func AddUint64

func AddUint64(val, add uint64)

AddUint64 CAS增加uint64

Types

type ConcurrentIntArray

type ConcurrentIntArray interface {
	// Set 用于设置指定索引上的元素值。
	Set(index int, elem int) (old int, err error)
	// Get 用于获取指定索引上的元素值。
	Get(index int) (elem int, err error)
	// Len 用于获取数组的长度。
	Len() int
}

ConcurrentIntArray int类型并发安全切片

func NewConcurrentIntArray

func NewConcurrentIntArray(length int) ConcurrentIntArray

NewConcurrentIntArray 工厂方法

type ConcurrentStrArray

type ConcurrentStrArray interface {
	// Set 用于设置指定索引上的元素值。
	Set(index int, elem string) (old string, err error)
	// Get 用于获取指定索引上的元素值。
	Get(index int) (elem string, err error)
	// Len 用于获取数组的长度。
	Len() int
}

ConcurrentStrArray string类型并发安全切片

func NewConcurrentStrArray

func NewConcurrentStrArray(length int) ConcurrentStrArray

NewConcurrentStrArray 工厂方法

Jump to

Keyboard shortcuts

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