diff mbox

libgo patch committed: clear isSystemGoroutine in goexit

Message ID CAOyqgcV6jZK6LadmVyOVCoR+gmDA+O7jRaO4L+3qj15uBN4LbA@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor June 13, 2017, 12:44 a.m. UTC
This patch to libgo clears the isSystemGoroutine field of the g
structure when the goroutine exits.  Otherwise it may be set when the
g structure is reused via gfput/gfget.  Bootstrapped and ran Go
testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 249138)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-908fc7e46ebe36658ed86b65a3d165fccb2e8576
+3b44ad058abda0d1b0b6c928987270da50ab7431
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/runtime/proc.go
===================================================================
--- libgo/go/runtime/proc.go	(revision 249138)
+++ libgo/go/runtime/proc.go	(working copy)
@@ -2251,6 +2251,7 @@  func goexit0(gp *g) {
 	casgstatus(gp, _Grunning, _Gdead)
 	if isSystemGoroutine(gp) {
 		atomic.Xadd(&sched.ngsys, -1)
+		gp.isSystemGoroutine = false
 	}
 	gp.m = nil
 	gp.lockedm = nil