aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-01-27 14:01:20 -0800
committerRuss Cox <rsc@golang.org>2009-01-27 14:01:20 -0800
commit53e69e1db5d5960b33c93e05236afaca7f110b2b (patch)
treeeed590ded955f1f25cb25203b5ca94ece0716b75 /src/runtime/proc.c
parent47ab1c1e994847279b875da6255b773e2aefc7b5 (diff)
downloadgo-53e69e1db5d5960b33c93e05236afaca7f110b2b.tar.xz
various race conditions.
R=r DELTA=43 (29 added, 5 deleted, 9 changed) OCL=23608 CL=23611
Diffstat (limited to 'src/runtime/proc.c')
-rw-r--r--src/runtime/proc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/runtime/proc.c b/src/runtime/proc.c
index 3fe08df94d..0b509bb875 100644
--- a/src/runtime/proc.c
+++ b/src/runtime/proc.c
@@ -397,7 +397,7 @@ nextgandunlock(void)
throw("all goroutines are asleep - deadlock!");
m->nextg = nil;
noteclear(&m->havenextg);
- if(sched.waitstop) {
+ if(sched.waitstop && sched.mcpu <= sched.mcpumax) {
sched.waitstop = 0;
notewakeup(&sched.stopped);
}
@@ -590,6 +590,10 @@ sys·entersyscall(uint64 callerpc, int64 trap)
sched.msyscall++;
if(sched.gwait != 0)
matchmg();
+ if(sched.waitstop && sched.mcpu <= sched.mcpumax) {
+ sched.waitstop = 0;
+ notewakeup(&sched.stopped);
+ }
unlock(&sched);
// leave SP around for gc; poison PC to make sure it's not used
g->sched.SP = (byte*)&callerpc;