sync

package
v0.8.14 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 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 AtomicBool

type AtomicBool int32

AtomicBool is an atomic Boolean. Its methods are all atomic, thus safe to be called by multiple goroutines simultaneously. Note: When embedding into a struct one should always use *AtomicBool to avoid copy. it's a simple implmentation from https://github.com/tevino/abool

func NewBool

func NewBool(ok bool) *AtomicBool

NewBool creates an AtomicBool with given default value.

func (*AtomicBool) IsSet

func (ab *AtomicBool) IsSet() bool

IsSet returns whether the Boolean is true.

func (*AtomicBool) Set

func (ab *AtomicBool) Set()

Set sets the Boolean to true.

func (*AtomicBool) UnSet

func (ab *AtomicBool) UnSet()

UnSet sets the Boolean to false.

Jump to

Keyboard shortcuts

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