runtime

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StopProfiling = os.Getenv("SONIC_STOP_PROFILING") != ""

StopProfiling is used to stop traceback introduced by SIGPROF while native code is running. WARN: this option is only a workaround for traceback issue (https://github.com/bytedance/sonic/issues/310), and will be dropped when the issue is fixed.

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 GcwbAddr added in v1.8.3

func GcwbAddr() uintptr

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.

func MoreStack added in v1.8.3

func MoreStack(size uintptr)

func StartProf added in v1.8.3

func StartProf()

func StopProf added in v1.8.3

func StopProf()

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