atomic

package
v1.3.25 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package atomic provides simple wrappers around numerics to enforce atomic access.

  • Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool atomic.Bool

func NewBool

func NewBool(i bool) *Bool

func (*Bool) CAS

func (v *Bool) CAS(o, n bool) bool

func (*Bool) Load

func (v *Bool) Load() bool

func (*Bool) MarshalJSON

func (v *Bool) MarshalJSON() ([]byte, error)

func (*Bool) Store

func (v *Bool) Store(n bool)

func (*Bool) Swap

func (v *Bool) Swap(n bool) bool

func (*Bool) Toggle

func (v *Bool) Toggle() bool

func (*Bool) UnmarshalJSON

func (v *Bool) UnmarshalJSON(data []byte) error

type Int32

type Int32 atomic.Int32

func NewInt32

func NewInt32(i int32) *Int32

func (*Int32) Add

func (v *Int32) Add(n int32) int32

func (*Int32) CAS

func (v *Int32) CAS(o, n int32) bool

func (*Int32) Dec

func (v *Int32) Dec() int32

func (*Int32) Inc

func (v *Int32) Inc() int32

func (*Int32) Load

func (v *Int32) Load() int32

func (*Int32) Store

func (v *Int32) Store(n int32)

func (*Int32) Swap

func (v *Int32) Swap(n int32) int32

type Int64

type Int64 atomic.Int64

func NewInt64

func NewInt64(i int64) *Int64

func (*Int64) Add

func (v *Int64) Add(n int64) int64

func (*Int64) CAS

func (v *Int64) CAS(o, n int64) bool

func (*Int64) Dec

func (v *Int64) Dec() int64

func (*Int64) Inc

func (v *Int64) Inc() int64

func (*Int64) Load

func (v *Int64) Load() int64

func (*Int64) Store

func (v *Int64) Store(n int64)

func (*Int64) Sub

func (v *Int64) Sub(n int64) int64

func (*Int64) Swap

func (v *Int64) Swap(n int64) int64

type Time

type Time atomic.Int64

func NewTime

func NewTime(t time.Time) *Time

func (*Time) Load

func (t *Time) Load() time.Time

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) Store

func (t *Time) Store(n time.Time)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

type Uint32

type Uint32 atomic.Uint32

func NewUint32

func NewUint32(i uint32) *Uint32

func (*Uint32) Add

func (v *Uint32) Add(n uint32) uint32

func (*Uint32) CAS

func (v *Uint32) CAS(o, n uint32) bool

func (*Uint32) Inc

func (v *Uint32) Inc() uint32

func (*Uint32) Load

func (v *Uint32) Load() uint32

func (*Uint32) Store

func (v *Uint32) Store(n uint32)

func (*Uint32) Swap

func (v *Uint32) Swap(n uint32) uint32

type Uint64

type Uint64 atomic.Uint64

func NewUint64

func NewUint64(i uint64) *Uint64

func (*Uint64) Add

func (v *Uint64) Add(n uint64) uint64

func (*Uint64) CAS

func (v *Uint64) CAS(o, n uint64) bool

func (*Uint64) Inc

func (v *Uint64) Inc() uint64

func (*Uint64) Load

func (v *Uint64) Load() uint64

func (*Uint64) Store

func (v *Uint64) Store(n uint64)

func (*Uint64) Sub

func (v *Uint64) Sub(n uint64) uint64

func (*Uint64) Swap

func (v *Uint64) Swap(n uint64) uint64

Jump to

Keyboard shortcuts

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