diff options
author | Tao Qingyun <qingyunha@gmail.com> | 2021-06-22 00:24:05 +0000 |
---|---|---|
committer | Alexander Rakoczy <alex@golang.org> | 2021-06-25 17:31:39 +0000 |
commit | d01bc571f7e55c7376f34e86be4e5660887bd30c (patch) | |
tree | 2c8a7170ee2a2cab388b65f735ca9fa3df63cbfc /src/runtime/cgocall.go | |
parent | 37f9a8f69d6299783eac8848d87e27eb563500ac (diff) | |
download | go-d01bc571f7e55c7376f34e86be4e5660887bd30c.tar.gz go-d01bc571f7e55c7376f34e86be4e5660887bd30c.zip |
runtime: make ncgocall a global counter
ncgocall was stored per M, runtime.NumCgoCall lost the counter when a M die.
Fixes #46789
Change-Id: I85831fbb2713f4c30d1800d07e1f47aa0031970e
GitHub-Last-Rev: cbc15fa870de776d3fbf3b62fc9a5e01792e6a26
GitHub-Pull-Request: golang/go#46842
Reviewed-on: https://go-review.googlesource.com/c/go/+/329729
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Alexander Rakoczy <alex@golang.org>
Diffstat (limited to 'src/runtime/cgocall.go')
-rw-r--r-- | src/runtime/cgocall.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go index 0e287d0b8e..8ffb48a888 100644 --- a/src/runtime/cgocall.go +++ b/src/runtime/cgocall.go @@ -110,6 +110,8 @@ func syscall_cgocaller(fn unsafe.Pointer, args ...uintptr) uintptr { return as.retval } +var ncgocall uint64 // number of cgo calls in total for dead m + // Call from Go to C. // // This must be nosplit because it's used for syscalls on some |