diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-07-17 12:52:37 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2013-07-17 12:52:37 -0400 |
| commit | 5887f142a33fbb8da94088e902ced4101a16aa8f (patch) | |
| tree | 34e4b531885ee16e020a5fc0289a4836f561f7ed /src/pkg/runtime/stack.c | |
| parent | a83748596c009db47bcd35a69531e485e2c7f924 (diff) | |
| download | go-5887f142a33fbb8da94088e902ced4101a16aa8f.tar.xz | |
runtime: more reliable preemption
Currently preemption signal g->stackguard0==StackPreempt
can be lost if it is received when preemption is disabled
(e.g. m->lock!=0). This change duplicates the preemption
signal in g->preempt and restores g->stackguard0
when preemption is enabled.
Update #543.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/10792043
Diffstat (limited to 'src/pkg/runtime/stack.c')
| -rw-r--r-- | src/pkg/runtime/stack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c index 9de692bba4..2ba29956b1 100644 --- a/src/pkg/runtime/stack.c +++ b/src/pkg/runtime/stack.c @@ -250,7 +250,7 @@ runtime·newstack(void) // We are interested in preempting user Go code, not runtime code. if(oldstatus != Grunning || m->locks || m->mallocing || m->gcing) { // Let the goroutine keep running for now. - // TODO(dvyukov): remember but delay the preemption. + // gp->preempt is set, so it will be preempted next time. gp->stackguard0 = gp->stackguard; gp->status = oldstatus; runtime·gogo(&gp->sched); // never return |
