From: Damien Neil Date: Wed, 20 Nov 2024 16:25:20 +0000 (-0800) Subject: runtime: remove unused casgcopystack function X-Git-Tag: go1.24rc1~195 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2c02b4a2529528ddcbea493d179e8e766cba9ddb;p=gostls13.git runtime: remove unused casgcopystack function Change-Id: I349b24ba5259d7abb0ae37065f704517aa4decda Reviewed-on: https://go-review.googlesource.com/c/go/+/630155 Reviewed-by: Michael Pratt Auto-Submit: Damien Neil LUCI-TryBot-Result: Go LUCI --- diff --git a/src/runtime/proc.go b/src/runtime/proc.go index e7f44c5b6c..6362960200 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -1317,28 +1317,6 @@ func casGToWaitingForGC(gp *g, old uint32, reason waitReason) { casGToWaiting(gp, old, reason) } -// casgstatus(gp, oldstatus, Gcopystack), assuming oldstatus is Gwaiting or Grunnable. -// Returns old status. Cannot call casgstatus directly, because we are racing with an -// async wakeup that might come in from netpoll. If we see Gwaiting from the readgstatus, -// it might have become Grunnable by the time we get to the cas. If we called casgstatus, -// it would loop waiting for the status to go back to Gwaiting, which it never will. -// -//go:nosplit -func casgcopystack(gp *g) uint32 { - for { - oldstatus := readgstatus(gp) &^ _Gscan - if oldstatus != _Gwaiting && oldstatus != _Grunnable { - throw("copystack: bad status, not Gwaiting or Grunnable") - } - if gp.atomicstatus.CompareAndSwap(oldstatus, _Gcopystack) { - if sg := gp.syncGroup; sg != nil { - sg.changegstatus(gp, oldstatus, _Gcopystack) - } - return oldstatus - } - } -} - // casGToPreemptScan transitions gp from _Grunning to _Gscan|_Gpreempted. // // TODO(austin): This is the only status operation that both changes