mirror of
https://github.com/golang/go
synced 2024-10-03 18:21:21 -06:00
runtime: add Goroutines
R=rsc CC=golang-dev https://golang.org/cl/3508041
This commit is contained in:
parent
63544c4754
commit
51a2183851
@ -26,6 +26,9 @@ func GOMAXPROCS(n int) int
|
|||||||
// Cgocalls returns the number of cgo calls made by the current process.
|
// Cgocalls returns the number of cgo calls made by the current process.
|
||||||
func Cgocalls() int64
|
func Cgocalls() int64
|
||||||
|
|
||||||
|
// Goroutines returns the number of goroutines that currently exist.
|
||||||
|
func Goroutines() int32
|
||||||
|
|
||||||
type MemStatsType struct {
|
type MemStatsType struct {
|
||||||
// General statistics.
|
// General statistics.
|
||||||
// Not locked during update; approximate.
|
// Not locked during update; approximate.
|
||||||
|
@ -1192,3 +1192,10 @@ runtime·mid(uint32 ret)
|
|||||||
ret = m->id;
|
ret = m->id;
|
||||||
FLUSH(&ret);
|
FLUSH(&ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
runtime·Goroutines(int32 ret)
|
||||||
|
{
|
||||||
|
ret = runtime·sched.gcount;
|
||||||
|
FLUSH(&ret);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user