internal

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CeilToPowerOfTwo

func CeilToPowerOfTwo(n int) int

CeilToPowerOfTwo returns the least power of two integer value greater than or equal to n.

func FloorToPowerOfTwo

func FloorToPowerOfTwo(n int) int

FloorToPowerOfTwo returns the greatest power of two integer value less than or equal to n.

func IsPowerOfTwo

func IsPowerOfTwo(n int) bool

IsPowerOfTwo reports whether given integer is a power of two.

func SpinLock added in v1.0.0

func SpinLock() sync.Locker

SpinLock creates a new spin-lock.

Types

type AsyncJobQueue added in v1.0.0

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

AsyncJobQueue queues pending tasks.

func NewAsyncJobQueue added in v1.0.0

func NewAsyncJobQueue() AsyncJobQueue

NewAsyncJobQueue creates a note-queue.

func (*AsyncJobQueue) ForEach added in v1.0.0

func (q *AsyncJobQueue) ForEach() (err error)

ForEach iterates this queue and executes each note with a given func.

func (*AsyncJobQueue) Push added in v1.0.0

func (q *AsyncJobQueue) Push(job Job)

Push pushes a item into queue.

type Job added in v1.0.0

type Job func() error

Job is a asynchronous function.

Jump to

Keyboard shortcuts

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