mirror of
https://github.com/golang/go
synced 2024-11-12 04:50:21 -07:00
runtime: rename Cgocalls and Goroutines to NumCgoCall and NumGoroutine, respectively.
Update some other docs too. Update #2955. R=rsc CC=golang-dev https://golang.org/cl/5676060
This commit is contained in:
parent
7fc47928fc
commit
4b171e5040
@ -648,7 +648,7 @@ func TestTransportPersistConnLeak(t *testing.T) {
|
|||||||
tr := &Transport{}
|
tr := &Transport{}
|
||||||
c := &Client{Transport: tr}
|
c := &Client{Transport: tr}
|
||||||
|
|
||||||
n0 := runtime.Goroutines()
|
n0 := runtime.NumGoroutine()
|
||||||
|
|
||||||
const numReq = 25
|
const numReq = 25
|
||||||
didReqCh := make(chan bool)
|
didReqCh := make(chan bool)
|
||||||
@ -669,7 +669,7 @@ func TestTransportPersistConnLeak(t *testing.T) {
|
|||||||
<-gotReqCh
|
<-gotReqCh
|
||||||
}
|
}
|
||||||
|
|
||||||
nhigh := runtime.Goroutines()
|
nhigh := runtime.NumGoroutine()
|
||||||
|
|
||||||
// Tell all handlers to unblock and reply.
|
// Tell all handlers to unblock and reply.
|
||||||
for i := 0; i < numReq; i++ {
|
for i := 0; i < numReq; i++ {
|
||||||
@ -685,7 +685,7 @@ func TestTransportPersistConnLeak(t *testing.T) {
|
|||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
runtime.GC()
|
runtime.GC()
|
||||||
runtime.GC() // even more.
|
runtime.GC() // even more.
|
||||||
nfinal := runtime.Goroutines()
|
nfinal := runtime.NumGoroutine()
|
||||||
|
|
||||||
growth := nfinal - n0
|
growth := nfinal - n0
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ unlockm(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
runtime·Cgocalls(int64 ret)
|
runtime·NumCgoCall(int64 ret)
|
||||||
{
|
{
|
||||||
M *m;
|
M *m;
|
||||||
|
|
||||||
|
@ -26,11 +26,11 @@ func GOMAXPROCS(n int) int
|
|||||||
// NumCPU returns the number of logical CPUs on the local machine.
|
// NumCPU returns the number of logical CPUs on the local machine.
|
||||||
func NumCPU() int
|
func NumCPU() int
|
||||||
|
|
||||||
// Cgocalls returns the number of cgo calls made by the current process.
|
// NumCgoCall returns the number of cgo calls made by the current process.
|
||||||
func Cgocalls() int64
|
func NumCgoCall() int64
|
||||||
|
|
||||||
// Goroutines returns the number of goroutines that currently exist.
|
// NumGoroutine returns the number of goroutines that currently exist.
|
||||||
func Goroutines() int32
|
func NumGoroutine() int32
|
||||||
|
|
||||||
// Alloc allocates a block of the given size.
|
// Alloc allocates a block of the given size.
|
||||||
// FOR TESTING AND DEBUGGING ONLY.
|
// FOR TESTING AND DEBUGGING ONLY.
|
||||||
|
@ -141,10 +141,10 @@ func Version() string {
|
|||||||
return theVersion
|
return theVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
// GOOS is the Go tree's operating system target:
|
// GOOS is the running program's operating system target:
|
||||||
// one of darwin, freebsd, linux, and so on.
|
// one of darwin, freebsd, linux, and so on.
|
||||||
const GOOS string = theGoos
|
const GOOS string = theGoos
|
||||||
|
|
||||||
// GOARCH is the Go tree's architecture target:
|
// GOARCH is the running program's architecture target:
|
||||||
// 386, amd64, or arm.
|
// 386, amd64, or arm.
|
||||||
const GOARCH string = theGoarch
|
const GOARCH string = theGoarch
|
||||||
|
@ -342,7 +342,7 @@ mcommoninit(M *m)
|
|||||||
// Add to runtime·allm so garbage collector doesn't free m
|
// Add to runtime·allm so garbage collector doesn't free m
|
||||||
// when it is just in a register or thread-local storage.
|
// when it is just in a register or thread-local storage.
|
||||||
m->alllink = runtime·allm;
|
m->alllink = runtime·allm;
|
||||||
// runtime·Cgocalls() iterates over allm w/o schedlock,
|
// runtime·NumCgoCall() iterates over allm w/o schedlock,
|
||||||
// so we need to publish it safely.
|
// so we need to publish it safely.
|
||||||
runtime·atomicstorep(&runtime·allm, m);
|
runtime·atomicstorep(&runtime·allm, m);
|
||||||
}
|
}
|
||||||
@ -1652,7 +1652,7 @@ runtime·mid(uint32 ret)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
runtime·Goroutines(int32 ret)
|
runtime·NumGoroutine(int32 ret)
|
||||||
{
|
{
|
||||||
ret = runtime·sched.gcount;
|
ret = runtime·sched.gcount;
|
||||||
FLUSH(&ret);
|
FLUSH(&ret);
|
||||||
|
Loading…
Reference in New Issue
Block a user