1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:04:40 -07:00

runtime: switch state back to Grunning after recovery

Fixes #733.

R=r
CC=golang-dev
https://golang.org/cl/958041
This commit is contained in:
Russ Cox 2010-04-21 16:27:41 -07:00
parent e7b6fe3989
commit 214a55b06a
2 changed files with 3 additions and 2 deletions

View 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;
}

View 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);
}