runtime

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TickerInterval = time.Millisecond * 50

TickerInterval defines the interval used by the ticker in Check* functions.

Functions

func CheckContext

func CheckContext(ctx context.Context, t *testing.T) func()

CheckContext snapshots the currently-running goroutines and returns a function to be run at the end of tests to see whether any goroutines leaked.

func GetCallerFrame

func GetCallerFrame(skip int) (frame runtime.Frame, ok bool)

func GetFuncName

func GetFuncName(i interface{}) string

GetFuncName return the function name

func GoID

func GoID() (id uint64)

GoID returns the ID of current goroutine.

Types

type TaskPool

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

func NewTaskPool

func NewTaskPool(size int) *TaskPool

func (*TaskPool) Add

func (p *TaskPool) Add(delta int)

Add 新增一个执行

func (*TaskPool) Done

func (p *TaskPool) Done()

Done 执行完成减一

func (*TaskPool) Exec

func (t *TaskPool) Exec(f func())

func (*TaskPool) Wait

func (t *TaskPool) Wait()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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