aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.c
diff options
context:
space:
mode:
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;