Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(85)

Unified Diff: src/pkg/runtime/debug.go

Issue 3508041: code review 3508041: runtime: provide access to the number of existing goroutines (Closed)
Patch Set: code review 3508041: runtime: provide access to the number of existing goroutines Created 13 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pkg/runtime/proc.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/runtime/debug.go
===================================================================
--- a/src/pkg/runtime/debug.go
+++ b/src/pkg/runtime/debug.go
@@ -21,16 +21,19 @@ func UnlockOSThread()
// simultaneously and returns the previous setting. If n < 1, it does not
// change the current setting.
// This call will go away when the scheduler improves.
func GOMAXPROCS(n int) int
// Cgocalls returns the number of cgo calls made by the current process.
func Cgocalls() int64
+// Goroutines returns the number of goroutines that currently exist.
+func Goroutines() int32
+
type MemStatsType struct {
// General statistics.
// Not locked during update; approximate.
Alloc uint64 // bytes allocated and still in use
TotalAlloc uint64 // bytes allocated (even if freed)
Sys uint64 // bytes obtained from system (should be sum of XxxSys below)
Lookups uint64 // number of pointer lookups
Mallocs uint64 // number of mallocs
« no previous file with comments | « no previous file | src/pkg/runtime/proc.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b