mirror of
https://github.com/golang/go.git
synced 2025-11-10 21:51:05 +00:00
runtime: rename m.gcing to m.preemptoff and make it a string
m.gcing has become overloaded to mean "don't preempt this g" in general. Once the garbage collector is preemptible, the one thing it *won't* mean is that we're in the garbage collector. So, rename gcing to "preemptoff" and make it a string giving a reason that preemption is disabled. gcing was never set to anything but 0 or 1, so we don't have to worry about there being a stack of reasons. Change-Id: I4337c29e8e942e7aa4f106fc29597e1b5de4ef46 Reviewed-on: https://go-review.googlesource.com/3660 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
f95becaddb
commit
28b5118415
13 changed files with 36 additions and 32 deletions
|
|
@ -362,7 +362,7 @@ func gcwork(force int32) {
|
|||
// Ok, we're doing it! Stop everybody else
|
||||
|
||||
mp := acquirem()
|
||||
mp.gcing = 1
|
||||
mp.preemptoff = "gcing"
|
||||
releasem(mp)
|
||||
gctimer.count++
|
||||
if force == 0 {
|
||||
|
|
@ -443,7 +443,7 @@ func gcwork(force int32) {
|
|||
}
|
||||
|
||||
// all done
|
||||
mp.gcing = 0
|
||||
mp.preemptoff = ""
|
||||
|
||||
if force == 0 {
|
||||
gctimer.cycle.sweep = nanotime()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue