From: Keith Randall Date: Fri, 14 Jun 2013 18:42:51 +0000 (-0700) Subject: runtime: garbage collector runs on g0 now. X-Git-Tag: go1.2rc2~1243 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=de316388a7fe6879fdaf0ad262c200d3810d0079;p=gostls13.git runtime: garbage collector runs on g0 now. No need to change to Grunnable state. Add some more checks for Grunning state. R=golang-dev, rsc, khr, dvyukov CC=golang-dev https://golang.org/cl/10186045 --- diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index dc38e2aff5..a55ee49c77 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -1541,8 +1541,10 @@ addroots(void) case Gdead: break; case Grunning: - if(gp != g) + if(gp != m->curg) runtime·throw("mark - world not stopped"); + if(g != m->g0) + runtime·throw("gc not on g0"); addstackroots(gp); break; case Grunnable: @@ -2035,9 +2037,7 @@ runtime·gc(int32 force) static void mgc(G *gp) { - gp->status = Grunnable; gc(gp->param); - gp->status = Grunning; gp->param = nil; runtime·gogo(&gp->sched); }