1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:00:22 -07:00

runtime: remove singleproc var

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
This commit is contained in:
Dmitriy Vyukov 2013-08-05 22:58:02 +04:00
parent f73972fa33
commit d5ab784611
3 changed files with 3 additions and 6 deletions

View File

@ -2347,7 +2347,7 @@ runtime·markallocated(void *v, uintptr n, bool noptr)
bits = (obits & ~(bitMask<<shift)) | (bitAllocated<<shift);
if(noptr)
bits |= bitNoPointers<<shift;
if(runtime·singleproc) {
if(runtime·gomaxprocs == 1) {
*b = bits;
break;
} else {
@ -2377,7 +2377,7 @@ runtime·markfreed(void *v, uintptr n)
for(;;) {
obits = *b;
bits = (obits & ~(bitMask<<shift)) | (bitBlockBoundary<<shift);
if(runtime·singleproc) {
if(runtime·gomaxprocs == 1) {
*b = bits;
break;
} else {
@ -2497,7 +2497,7 @@ runtime·setblockspecial(void *v, bool s)
bits = obits | (bitSpecial<<shift);
else
bits = obits & ~(bitSpecial<<shift);
if(runtime·singleproc) {
if(runtime·gomaxprocs == 1) {
*b = bits;
break;
} else {

View File

@ -61,7 +61,6 @@ enum { MaxGomaxprocs = 1<<8 };
Sched runtime·sched;
int32 runtime·gomaxprocs;
uint32 runtime·needextram;
bool runtime·singleproc;
bool runtime·iscgo;
uint32 runtime·gcwaiting;
M runtime·m0;
@ -2060,7 +2059,6 @@ procresize(int32 new)
p->status = Pidle;
pidleput(p);
}
runtime·singleproc = new == 1;
runtime·atomicstore((uint32*)&runtime·gomaxprocs, new);
}

View File

@ -700,7 +700,6 @@ extern M* runtime·allm;
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;