mirror of
https://github.com/golang/go
synced 2024-11-13 19:00:25 -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:
parent
f73972fa33
commit
d5ab784611
@ -2347,7 +2347,7 @@ runtime·markallocated(void *v, uintptr n, bool noptr)
|
|||||||
bits = (obits & ~(bitMask<<shift)) | (bitAllocated<<shift);
|
bits = (obits & ~(bitMask<<shift)) | (bitAllocated<<shift);
|
||||||
if(noptr)
|
if(noptr)
|
||||||
bits |= bitNoPointers<<shift;
|
bits |= bitNoPointers<<shift;
|
||||||
if(runtime·singleproc) {
|
if(runtime·gomaxprocs == 1) {
|
||||||
*b = bits;
|
*b = bits;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
@ -2377,7 +2377,7 @@ runtime·markfreed(void *v, uintptr n)
|
|||||||
for(;;) {
|
for(;;) {
|
||||||
obits = *b;
|
obits = *b;
|
||||||
bits = (obits & ~(bitMask<<shift)) | (bitBlockBoundary<<shift);
|
bits = (obits & ~(bitMask<<shift)) | (bitBlockBoundary<<shift);
|
||||||
if(runtime·singleproc) {
|
if(runtime·gomaxprocs == 1) {
|
||||||
*b = bits;
|
*b = bits;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
@ -2497,7 +2497,7 @@ runtime·setblockspecial(void *v, bool s)
|
|||||||
bits = obits | (bitSpecial<<shift);
|
bits = obits | (bitSpecial<<shift);
|
||||||
else
|
else
|
||||||
bits = obits & ~(bitSpecial<<shift);
|
bits = obits & ~(bitSpecial<<shift);
|
||||||
if(runtime·singleproc) {
|
if(runtime·gomaxprocs == 1) {
|
||||||
*b = bits;
|
*b = bits;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
@ -61,7 +61,6 @@ enum { MaxGomaxprocs = 1<<8 };
|
|||||||
Sched runtime·sched;
|
Sched runtime·sched;
|
||||||
int32 runtime·gomaxprocs;
|
int32 runtime·gomaxprocs;
|
||||||
uint32 runtime·needextram;
|
uint32 runtime·needextram;
|
||||||
bool runtime·singleproc;
|
|
||||||
bool runtime·iscgo;
|
bool runtime·iscgo;
|
||||||
uint32 runtime·gcwaiting;
|
uint32 runtime·gcwaiting;
|
||||||
M runtime·m0;
|
M runtime·m0;
|
||||||
@ -2060,7 +2059,6 @@ procresize(int32 new)
|
|||||||
p->status = Pidle;
|
p->status = Pidle;
|
||||||
pidleput(p);
|
pidleput(p);
|
||||||
}
|
}
|
||||||
runtime·singleproc = new == 1;
|
|
||||||
runtime·atomicstore((uint32*)&runtime·gomaxprocs, new);
|
runtime·atomicstore((uint32*)&runtime·gomaxprocs, new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -700,7 +700,6 @@ extern M* runtime·allm;
|
|||||||
extern P** runtime·allp;
|
extern P** runtime·allp;
|
||||||
extern int32 runtime·gomaxprocs;
|
extern int32 runtime·gomaxprocs;
|
||||||
extern uint32 runtime·needextram;
|
extern uint32 runtime·needextram;
|
||||||
extern bool runtime·singleproc;
|
|
||||||
extern uint32 runtime·panicking;
|
extern uint32 runtime·panicking;
|
||||||
extern uint32 runtime·gcwaiting; // gc is waiting to run
|
extern uint32 runtime·gcwaiting; // gc is waiting to run
|
||||||
extern int8* runtime·goos;
|
extern int8* runtime·goos;
|
||||||
|
Loading…
Reference in New Issue
Block a user