gcwaiting = 1;
sched.mcpumax = 1;
while(sched.mcpu > 1) {
+ // It would be unsafe for multiple threads to be using
+ // the stopped note at once, but there is only
+ // ever one thread doing garbage collection,
+ // so this is okay.
noteclear(&sched.stopped);
sched.waitstop = 1;
unlock(&sched);
Stktop *top, *oldtop;
Panic *p;
+ fp = getcallersp(fp);
+
// Must be a panic going on.
if((p = g->panic) == nil || p->recovered)
goto nomatch;
lock(&sched);
sched.gomaxprocs = n;
sched.mcpumax = n;
- // handle fewer procs
- while(sched.mcpu > sched.mcpumax) {
- noteclear(&sched.stopped);
- sched.waitstop = 1;
+ // handle fewer procs?
+ if(sched.mcpu > sched.mcpumax) {
unlock(&sched);
- notesleep(&sched.stopped);
- lock(&sched);
+ // just give up the cpu.
+ // we'll only get rescheduled once the
+ // number has come down.
+ gosched();
+ return;
}
// handle more procs
matchmg();
import (
"os"
"strings"
+ "syscall"
)
var x = make([]byte, 10)
}
func test7() {
+ if syscall.ARCH == "arm" {
+ // ARM doesn't have floating point yet
+ return
+ }
defer mustRecover("complex divide by zero")
var x, y complex
println(x / y)