]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: reduce locks held at once in resolveUnderlying
authorMark Freeman <mark@golang.org>
Thu, 23 Oct 2025 20:48:00 +0000 (16:48 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 28 Oct 2025 15:27:54 +0000 (08:27 -0700)
commitb8aa1ee442921b9517b53bf079ff5b4c2c89a54d
tree6ad93ba8e9b0f1fa6ef2930ad2abd4802a5c6b21
parent24af44143749c864d9e7d7f5d7d60c02e6662b2a
go/types, types2: reduce locks held at once in resolveUnderlying

There is no need to hold locks for the entire chain of Named types in
resolveUnderlying. This change moves the locking / unlocking right to
where t.underlying is set.

This change consolidates logic into resolveUnderlying where possible
and makes minor stylistic / documentation adjustments.

Change-Id: Ic5ec5a7e9a0da8bc34954bf456e4e23a28df296d
Reviewed-on: https://go-review.googlesource.com/c/go/+/714403
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/types2/named.go
src/go/types/named.go