atomic

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: GPL-3.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 Counter

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

Counter is an atomic counter

func (*Counter) Add

func (counter *Counter) Add(value int64) int64

Add adds value to counter

func (*Counter) Decrement

func (counter *Counter) Decrement() int64

Decrement decrements counter

func (*Counter) Get

func (counter *Counter) Get() int64

Get gets counter

func (*Counter) GetUint64

func (counter *Counter) GetUint64() uint64

GetUint64 gets counter as uint64

func (*Counter) Increment

func (counter *Counter) Increment() int64

Increment increments counter

func (*Counter) Reset

func (counter *Counter) Reset() int64

Reset resets counter and returns the previous value

func (*Counter) Set

func (counter *Counter) Set(value int64)

Set sets counter

func (*Counter) Subtract

func (counter *Counter) Subtract(value int64) int64

Subtract subtracts value from counter

type Flag

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

Flag is an atomic flag

func (*Flag) IsSet

func (flag *Flag) IsSet() bool

IsSet checks whether flag is set

func (*Flag) Set

func (flag *Flag) Set() bool

Set sets flag and returns its previous value

func (*Flag) Toggle

func (flag *Flag) Toggle(set bool)

Toggle toggles the flag

func (*Flag) Unset

func (flag *Flag) Unset()

Unset sets flag

type Int64

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

Int64 is a wrapper for atomic operations on int64

func (*Int64) Get

func (variable *Int64) Get() int64

Get gets the value

func (*Int64) Set

func (variable *Int64) Set(value int64)

Set sets the value

type String

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

String is a wrapper for atomic operations on String

func (*String) Get

func (variable *String) Get() string

Get gets the value

func (*String) Set

func (variable *String) Set(value string)

Set sets the value

type Uint32

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

Uint32 is a wrapper for atomic operations on uint32

func (*Uint32) Get

func (variable *Uint32) Get() uint32

Get gets the value

func (*Uint32) Set

func (variable *Uint32) Set(value uint32)

Set sets the value

type Uint64

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

Uint64 is a wrapper for atomic operations on uint64

func (*Uint64) Get

func (variable *Uint64) Get() uint64

Get gets the value

func (*Uint64) Set

func (variable *Uint64) Set(value uint64)

Set sets the value

Jump to

Keyboard shortcuts

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