]> Cypherpunks repositories - gostls13.git/commit
runtime: make NumGoroutine and Stack agree not to include system goroutines
authorRuss Cox <rsc@golang.org>
Thu, 7 Jan 2016 02:16:01 +0000 (21:16 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 13 Jan 2016 01:46:01 +0000 (01:46 +0000)
commitfac8202c3ffdddf5d2b35a2c3620c1eb56018b9b
treeec9ed1a66478563127a9faa17fe8764705692c6a
parent1e066cad1ba23f4064545355b8737e4762dd6838
runtime: make NumGoroutine and Stack agree not to include system goroutines

[Repeat of CL 18343 with build fixes.]

Before, NumGoroutine counted system goroutines and Stack (usually) didn't show them,
which was inconsistent and confusing.

To resolve which way they should be consistent, it seems like

package main
import "runtime"
func main() { println(runtime.NumGoroutine()) }

should print 1 regardless of internal runtime details. Make it so.

Fixes #11706.

Change-Id: If26749fec06aa0ff84311f7941b88d140552e81d
Reviewed-on: https://go-review.googlesource.com/18432
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
misc/cgo/test/issue7978.go
src/runtime/mprof.go
src/runtime/proc.go
src/runtime/proc_test.go
src/runtime/runtime2.go
src/runtime/testdata/testprog/misc.go [new file with mode: 0644]