Exemple #1
0
func Callers(skip int, pc []uintptr) int {
	limit := hx.CallInt("", "Scheduler.getNumCallers", 1, hx.GetInt("", "this._goroutine"))
	for i := 0; i < limit; i++ {
		if i > skip {
			pc = append(pc, uintptr(hx.CallInt("", "Scheduler.getCallerX", 2, hx.GetInt("", "this._goroutine"), i)))
		}
	}
	return limit - skip
}
Exemple #2
0
func Caller(skip int) (pc uintptr, file string, line int, ok bool) {
	pc = uintptr(hx.CallInt("", "Scheduler.getCallerX", 2, hx.GetInt("", "this._goroutine"), 1+skip))
	fnc := FuncForPC(pc)
	file, line = fnc.FileLine(pc)
	ok = true
	if file == "" || line == 0 {
		ok = false
	}
	return
}
Exemple #3
0
// NumGoroutine returns the number of active goroutines (may be more than the number runable).
func NumGoroutine() int {
	return hx.CallInt("", "Scheduler.NumGoroutine", 0)
}