]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove unused casgcopystack function
authorDamien Neil <dneil@google.com>
Wed, 20 Nov 2024 16:25:20 +0000 (08:25 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 20 Nov 2024 16:47:29 +0000 (16:47 +0000)
Change-Id: I349b24ba5259d7abb0ae37065f704517aa4decda
Reviewed-on: https://go-review.googlesource.com/c/go/+/630155
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/runtime/proc.go

index e7f44c5b6c1642466c8c2957e52f6d253eaf709f..636296020048324b6ba24b6a9f0e94ae078ee07d 100644 (file)
@@ -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