1
0
mirror of https://github.com/golang/go synced 2024-11-25 21:57:57 -07:00

runtime gc bug.

semacquire might move to another m.

R=r
DELTA=5  (2 added, 2 deleted, 1 changed)
OCL=33317
CL=33326
This commit is contained in:
Russ Cox 2009-08-14 20:33:20 -07:00
parent 4023dce70f
commit b21425ddee

View 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);
}