atomic

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: GPL-3.0 Imports: 1 Imported by: 5

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) Reset added in v0.0.3

func (flag *Flag) Reset()

Reset resets the flag, putting it in off position

func (*Flag) SetReturningPrevious added in v0.0.3

func (flag *Flag) SetReturningPrevious() bool

SetReturningPrevious sets flag and returns its previous value

func (*Flag) SetValue added in v0.0.3

func (flag *Flag) SetValue(newValue bool)

SetValue sets the new value in the 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