From 28b51184156e1261bb92e7ec4050a794dd606fa6 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 30 Jan 2015 15:30:41 -0500 Subject: 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 --- src/runtime/panic.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/runtime/panic.go') diff --git a/src/runtime/panic.go b/src/runtime/panic.go index 09278afbed..e2a5c629da 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -353,11 +353,14 @@ func gopanic(e interface{}) { print("\n") throw("panic during malloc") } - if gp.m.gcing != 0 { + if gp.m.preemptoff != "" { print("panic: ") printany(e) print("\n") - throw("panic during gc") + print("preempt off reason: ") + print(gp.m.preemptoff) + print("\n") + throw("panic during preemptoff") } if gp.m.locks != 0 { print("panic: ") -- cgit v1.3-5-g9baa