diff options
author | Austin Clements <austin@google.com> | 2015-01-30 15:30:41 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2015-02-02 19:34:51 +0000 |
commit | 28b51184156e1261bb92e7ec4050a794dd606fa6 (patch) | |
tree | 8d8659e3e706f687b241e8068ef80ff80987c3d2 /src/runtime/debug.go | |
parent | f95becaddb539a45cc9bedbbbc9ee4a2433c1ab5 (diff) | |
download | go-28b51184156e1261bb92e7ec4050a794dd606fa6.tar.gz go-28b51184156e1261bb92e7ec4050a794dd606fa6.zip |
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>
Diffstat (limited to 'src/runtime/debug.go')
-rw-r--r-- | src/runtime/debug.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/debug.go b/src/runtime/debug.go index 105b79cfef..3ecaac10bc 100644 --- a/src/runtime/debug.go +++ b/src/runtime/debug.go @@ -24,13 +24,13 @@ func GOMAXPROCS(n int) int { semacquire(&worldsema, false) gp := getg() - gp.m.gcing = 1 + gp.m.preemptoff = "GOMAXPROCS" systemstack(stoptheworld) // newprocs will be processed by starttheworld newprocs = int32(n) - gp.m.gcing = 0 + gp.m.preemptoff = "" semrelease(&worldsema) systemstack(starttheworld) return ret |