summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-04-21 16:27:41 -0700
committerRuss Cox <rsc@golang.org>2010-04-21 16:27:41 -0700
commit857111428bbbeef6a845399f49c9f113db6bbfde (patch)
treea67e1a329bb372280a3e089f05366154272f5420
parent26634e5741a84a4893315ab76333269078faf6ec (diff)
downloadgolang-857111428bbbeef6a845399f49c9f113db6bbfde.tar.gz
runtime: switch state back to Grunning after recovery
Fixes issue 733. R=r CC=golang-dev http://codereview.appspot.com/958041
-rw-r--r--src/pkg/runtime/mgc0.c2
-rw-r--r--src/pkg/runtime/proc.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c
index 5265bea21..f78dabf88 100644
--- a/src/pkg/runtime/mgc0.c
+++ b/src/pkg/runtime/mgc0.c
@@ -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;
}
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 169f90b73..acbb3afa1 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -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);
}