From 78a3968c2c9f2d6e8eb6dc263b4a2517c72d71be Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Thu, 24 Jul 2025 21:38:37 +0000 Subject: runtime/metrics: add metric for current Go-owned thread count Fixes #15490. Change-Id: I6ce9edc46398030ff639e22d4ca4adebccdfe1b7 Reviewed-on: https://go-review.googlesource.com/c/go/+/690399 Auto-Submit: Michael Knyszek LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt --- src/runtime/runtime2.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/runtime/runtime2.go') diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index a80a34a18e..042c3137cd 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -1225,7 +1225,9 @@ var isIdleInSynctest = [len(waitReasonStrings)]bool{ } var ( - allm *m + // Linked-list of all Ms. Written under sched.lock, read atomically. + allm *m + gomaxprocs int32 numCPUStartup int32 forcegc forcegcstate -- cgit v1.3