]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove singleproc var
authorDmitriy Vyukov <dvyukov@google.com>
Mon, 5 Aug 2013 18:58:02 +0000 (22:58 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Mon, 5 Aug 2013 18:58:02 +0000 (22:58 +0400)
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

src/pkg/runtime/mgc0.c
src/pkg/runtime/proc.c
src/pkg/runtime/runtime.h

index f8da5457d8bbf3ae38f0e38876ab66f97b74b05d..be0f81879e47e580aa76ee772ac7b33e5f65ce4b 100644 (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 {
index c2ee6e94896f92ff9daa7eb64e08b91e017e6977..725a49668bf90042dc7975ec2d181ce3fc332f3d 100644 (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);
 }
 
index 15520b57eb0a75fd81f02c8bdf180d0b949996c7..951376a52fcd2bd68f5b8d45abc43eec0b1cd57b 100644 (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;