utils

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MulanPSL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	Runnable bool
}

func NewRunner

func NewRunner() *Runner

func (*Runner) Exec added in v1.0.5

func (_this *Runner) Exec(runnerFunc RunnerFunc) *Runner

func (*Runner) Failed added in v1.0.5

func (_this *Runner) Failed(runnerFunc RunnerFinishFunc) *Runner

func (*Runner) IsRunnable

func (_this *Runner) IsRunnable() bool

func (*Runner) Success added in v1.0.5

func (_this *Runner) Success(runnerFunc RunnerFinishFunc) *Runner

type RunnerFinishFunc

type RunnerFinishFunc func()

type RunnerFunc

type RunnerFunc func() bool

type SpinLock added in v1.0.4

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

SpinLock implements a simple atomic spin lock, the zero value for a SpinLock is an unlocked spinlock.

func (*SpinLock) Lock added in v1.0.4

func (sl *SpinLock) Lock()

Lock locks sl. If the lock is already in use, the caller blocks until Unlock is called

func (*SpinLock) String added in v1.0.4

func (sl *SpinLock) String() string

func (*SpinLock) TryLock added in v1.0.4

func (sl *SpinLock) TryLock() bool

TryLock will try to lock sl and return whether it succeed or not without blocking.

func (*SpinLock) Unlock added in v1.0.4

func (sl *SpinLock) Unlock()

Unlock unlocks sl, unlike [Mutex.Unlock](http://golang.org/pkg/sync/#Mutex.Unlock), there's no harm calling it on an unlocked SpinLock

Jump to

Keyboard shortcuts

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