aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2023-05-05 16:35:10 -0400
committerGopher Robot <gobot@golang.org>2023-05-08 16:39:39 +0000
commit77b1f23af70eb6e02b4d2f5ad18e462b86156971 (patch)
tree6314e8de90a73a073b95beb7a943a2660a748963 /test/codegen
parent5cad8d41ca09b4c0f68a3f1fd81ada13d6855ff1 (diff)
downloadgo-77b1f23af70eb6e02b4d2f5ad18e462b86156971.tar.xz
runtime: clean up extra M API
There are quite a few locations that get/put Ms from the extra M list, but the API is pretty clumsy to use. Add an easier to use getExtraM / putExtraM API. There are only two minor semantic changes: 1. dropm no longer calls setg(nil) inside the lockextra critical section. It is important that this thread no longer references the G (and in turn M) once it is published to the extra M list and another thread could acquire it. But there is no reason that needs to happen only after lockextra. 2. extraMLength (renamed from extraMCount) is no longer protected by lockextra and is instead simply an atomic (though writes are still in the critical section). The previous readers all dropped lockextra before using the value they read anyway. For #60004. Change-Id: Ifca4d6c84d605423855d89f49af400ca07de56f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/492742 Run-TryBot: Michael Pratt <mpratt@google.com> Commit-Queue: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'test/codegen')
0 files changed, 0 insertions, 0 deletions