Commit b21425dd authored by Russ Cox's avatar Russ Cox

runtime gc bug.

semacquire might move to another m.

R=r
DELTA=5  (2 added, 2 deleted, 1 changed)
OCL=33317
CL=33326
parent 4023dce7
...@@ -221,8 +221,8 @@ gc(int32 force) ...@@ -221,8 +221,8 @@ gc(int32 force)
return; return;
//printf("gc...\n"); //printf("gc...\n");
m->gcing = 1;
semacquire(&gcsema); semacquire(&gcsema);
m->gcing = 1;
stoptheworld(); stoptheworld();
if(mheap.Lock.key != 0) if(mheap.Lock.key != 0)
throw("mheap locked during gc"); throw("mheap locked during gc");
...@@ -232,6 +232,6 @@ gc(int32 force) ...@@ -232,6 +232,6 @@ gc(int32 force)
mstats.next_gc = mstats.inuse_pages+mstats.inuse_pages*gcpercent/100; mstats.next_gc = mstats.inuse_pages+mstats.inuse_pages*gcpercent/100;
} }
starttheworld(); starttheworld();
semrelease(&gcsema);
m->gcing = 0; m->gcing = 0;
semrelease(&gcsema);
} }
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