atomicutil

package
v0.0.0-...-cc86db0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 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 AtomicBoolean

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

AtomicBoolean provides boolean type with atomic opeartion, based on uint32 primitive type with atomic operators in sync/atomic package.

The zero-value of AtomicBoolean type relies on and is the zero-value of underlying uint32 primitive type, i.e., 0. This also allows users to instantiate an AtomicBoolean value without explicitly calling any constructor function.

func (*AtomicBoolean) Clear

func (v *AtomicBoolean) Clear()

func (*AtomicBoolean) CompareAndSwap

func (v *AtomicBoolean) CompareAndSwap(old, new bool) bool

func (*AtomicBoolean) IsSet

func (v *AtomicBoolean) IsSet() bool

func (*AtomicBoolean) Set

func (v *AtomicBoolean) Set()

type AtomicInt32

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

AtomicBoolean provides boolean type with atomic opeartion, based on uint32 primitive type with atomic operators in sync/atomic package.

The zero-value of AtomicBoolean type relies on and is the zero-value of underlying uint32 primitive type, i.e., 0. This also allows users to instantiate an AtomicBoolean value without explicitly calling any constructor function.

func (*AtomicInt32) Add

func (v *AtomicInt32) Add(delta int32) int32

func (*AtomicInt32) Load

func (v *AtomicInt32) Load() int32

func (*AtomicInt32) Store

func (v *AtomicInt32) Store(value int32)

Jump to

Keyboard shortcuts

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