]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: switch state back to Grunning after recovery
authorRuss Cox <rsc@golang.org>
Wed, 21 Apr 2010 23:27:41 +0000 (16:27 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 21 Apr 2010 23:27:41 +0000 (16:27 -0700)
Fixes #733.

R=r
CC=golang-dev
https://golang.org/cl/958041

src/pkg/runtime/mgc0.c
src/pkg/runtime/proc.c

index 5265bea21f15534612677ef2ee0a4bd78b2ff8ca..f78dabf88b1231c1afdba223de1bf284c19eaa99 100644 (file)
@@ -128,6 +128,7 @@ mark(void)
                case Gdead:
                        break;
                case Grunning:
+               case Grecovery:
                        if(gp != g)
                                throw("mark - world not stopped");
                        scanstack(gp);
@@ -135,7 +136,6 @@ mark(void)
                case Grunnable:
                case Gsyscall:
                case Gwaiting:
-               case Grecovery:
                        scanstack(gp);
                        break;
                }
index 169f90b7330c1c5af1cc8129ce357b487b452d25..acbb3afa156fb110d2d2df2e621a9c3442e8f3e3 100644 (file)
@@ -248,7 +248,7 @@ readylocked(G *g)
        }
 
        // Mark runnable.
-       if(g->status == Grunnable || g->status == Grunning)
+       if(g->status == Grunnable || g->status == Grunning || g->status == Grecovery)
                throw("bad g->status in ready");
        g->status = Grunnable;
 
@@ -472,6 +472,7 @@ scheduler(void)
                        // before it tests the return value.)
                        gp->sched.sp = getcallersp(d->sp - 2*sizeof(uintptr));
                        gp->sched.pc = d->pc;
+                       gp->status = Grunning;
                        free(d);
                        gogo(&gp->sched, 1);
                }