Commit d5ab7846 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

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
parent f73972fa
......@@ -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 {
......
......@@ -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);
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment