It was needed for the old scheduler,
because there temporary could be more threads than gomaxprocs.
In the new scheduler gomaxprocs is always respected.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
12438043
bits = (obits & ~(bitMask<<shift)) | (bitAllocated<<shift);
if(noptr)
bits |= bitNoPointers<<shift;
- if(runtime·singleproc) {
+ if(runtime·gomaxprocs == 1) {
*b = bits;
break;
} else {
for(;;) {
obits = *b;
bits = (obits & ~(bitMask<<shift)) | (bitBlockBoundary<<shift);
- if(runtime·singleproc) {
+ if(runtime·gomaxprocs == 1) {
*b = bits;
break;
} else {
bits = obits | (bitSpecial<<shift);
else
bits = obits & ~(bitSpecial<<shift);
- if(runtime·singleproc) {
+ if(runtime·gomaxprocs == 1) {
*b = bits;
break;
} else {
Sched runtime·sched;
int32 runtime·gomaxprocs;
uint32 runtime·needextram;
-bool runtime·singleproc;
bool runtime·iscgo;
uint32 runtime·gcwaiting;
M runtime·m0;
p->status = Pidle;
pidleput(p);
}
- runtime·singleproc = new == 1;
runtime·atomicstore((uint32*)&runtime·gomaxprocs, new);
}
extern P** runtime·allp;
extern int32 runtime·gomaxprocs;
extern uint32 runtime·needextram;
-extern bool runtime·singleproc;
extern uint32 runtime·panicking;
extern uint32 runtime·gcwaiting; // gc is waiting to run
extern int8* runtime·goos;