aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/debug.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-09-01 18:07:33 +0000
committerHeschi Kreinick <heschi@google.com>2022-09-01 18:08:05 +0000
commitef8414101fba959c8df220ca0e544781029ce111 (patch)
tree7d8250a0ae3a3c3f97a4f0162c900fa735605aea /src/runtime/debug.go
parent5a6db7c48fb8a1e7b6d8f59ba4e3b7ecb8c35fc7 (diff)
downloadgo-ef8414101fba959c8df220ca0e544781029ce111.tar.xz
Revert "runtime: convert ncgocall to atomic type"
This reverts CL 426075. Reason for revert: Import missing from cgocall.go. Change-Id: Iac17e914045b83da30484dbe2a624cde526fb175 Reviewed-on: https://go-review.googlesource.com/c/go/+/427614 Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'src/runtime/debug.go')
-rw-r--r--src/runtime/debug.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/debug.go b/src/runtime/debug.go
index 531c316b97..669c36f0d5 100644
--- a/src/runtime/debug.go
+++ b/src/runtime/debug.go
@@ -45,7 +45,7 @@ func NumCPU() int {
// NumCgoCall returns the number of cgo calls made by the current process.
func NumCgoCall() int64 {
- var n = int64(ncgocall.Load())
+ var n = int64(atomic.Load64(&ncgocall))
for mp := (*m)(atomic.Loadp(unsafe.Pointer(&allm))); mp != nil; mp = mp.alllink {
n += int64(mp.ncgocall)
}