aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index cb5a80455d..54408dbab7 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -1067,7 +1067,7 @@ func casfrom_Gscanstatus(gp *g, oldval, newval uint32) {
dumpgstatus(gp)
throw("casfrom_Gscanstatus: gp->status is not in scan state")
}
- releaseLockRank(lockRankGscan)
+ releaseLockRankAndM(lockRankGscan)
}
// This will return false if the gp is not in the expected status and the cas fails.
@@ -1081,7 +1081,7 @@ func castogscanstatus(gp *g, oldval, newval uint32) bool {
if newval == oldval|_Gscan {
r := gp.atomicstatus.CompareAndSwap(oldval, newval)
if r {
- acquireLockRank(lockRankGscan)
+ acquireLockRankAndM(lockRankGscan)
}
return r
@@ -1110,8 +1110,7 @@ func casgstatus(gp *g, oldval, newval uint32) {
})
}
- acquireLockRank(lockRankGscan)
- releaseLockRank(lockRankGscan)
+ lockWithRankMayAcquire(nil, lockRankGscan)
// See https://golang.org/cl/21503 for justification of the yield delay.
const yieldDelay = 5 * 1000
@@ -1245,7 +1244,7 @@ func casGToPreemptScan(gp *g, old, new uint32) {
if old != _Grunning || new != _Gscan|_Gpreempted {
throw("bad g transition")
}
- acquireLockRank(lockRankGscan)
+ acquireLockRankAndM(lockRankGscan)
for !gp.atomicstatus.CompareAndSwap(_Grunning, _Gscan|_Gpreempted) {
}
}