Bug 1120591 - Avoid race condition updating gcTriggerBytes_ between main and background threads r=terrence

This commit is contained in:
Jon Coppeard 2015-01-22 09:38:54 +00:00
Родитель b05e307454
Коммит 187c1abc2a
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -5111,6 +5111,8 @@ GCRuntime::endSweepingZoneGroup()
for (GCZoneGroupIter zone(rt); !zone.done(); zone.next()) { for (GCZoneGroupIter zone(rt); !zone.done(); zone.next()) {
MOZ_ASSERT(zone->isGCSweeping()); MOZ_ASSERT(zone->isGCSweeping());
zone->setGCState(Zone::Finished); zone->setGCState(Zone::Finished);
zone->threshold.updateAfterGC(zone->usage.gcBytes(), invocationKind, tunables,
schedulingState);
} }
/* Start background thread to sweep zones if required. */ /* Start background thread to sweep zones if required. */
@ -5547,8 +5549,6 @@ GCRuntime::finishCollection()
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) { for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
if (zone->isCollecting()) { if (zone->isCollecting()) {
MOZ_ASSERT(zone->isGCFinished() || zone->isGCCompacting()); MOZ_ASSERT(zone->isGCFinished() || zone->isGCCompacting());
zone->threshold.updateAfterGC(zone->usage.gcBytes(), invocationKind, tunables,
schedulingState);
zone->setGCState(Zone::NoGC); zone->setGCState(Zone::NoGC);
zone->active = false; zone->active = false;
} }