]> Cypherpunks repositories - gostls13.git/commitdiff
runtime gc bug.
authorRuss Cox <rsc@golang.org>
Sat, 15 Aug 2009 03:33:20 +0000 (20:33 -0700)
committerRuss Cox <rsc@golang.org>
Sat, 15 Aug 2009 03:33:20 +0000 (20:33 -0700)
semacquire might move to another m.

R=r
DELTA=5  (2 added, 2 deleted, 1 changed)
OCL=33317
CL=33326

src/pkg/runtime/mgc0.c

index 52e36745fb3f1bbf100b3dbedb0330829e0ea29b..d27c186f412327ee83eee410aabe26f68bc9259b 100644 (file)
@@ -221,8 +221,8 @@ gc(int32 force)
                return;
 
 //printf("gc...\n");
-       m->gcing = 1;
        semacquire(&gcsema);
+       m->gcing = 1;
        stoptheworld();
        if(mheap.Lock.key != 0)
                throw("mheap locked during gc");
@@ -232,6 +232,6 @@ gc(int32 force)
                mstats.next_gc = mstats.inuse_pages+mstats.inuse_pages*gcpercent/100;
        }
        starttheworld();
-       semrelease(&gcsema);
        m->gcing = 0;
+       semrelease(&gcsema);
 }