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>
return as.retval
}
-var ncgocall atomic.Uint64 // number of cgo calls in total for dead m
+var ncgocall uint64 // number of cgo calls in total for dead m
// Call from Go to C.
//
// 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)
}
}
unlock(&sched.lock)
- ncgocall.Add(int64(mp.ncgocall))
+ atomic.Xadd64(&ncgocall, int64(mp.ncgocall))
// Release the P.
handoffp(releasep())