Bug 1166041 - Wait for nursery sweeping to finish before shutting down; r=jonco

--HG--
extra : rebase_source : 69979426eea5b35354b22dc744e794ed33438398
This commit is contained in:
Terrence Cole 2015-07-29 08:57:14 -07:00
Родитель 3940b5fcb7
Коммит 444e5712a9
2 изменённых файлов: 5 добавлений и 0 удалений

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

@ -638,6 +638,7 @@ js::Nursery::freeMallocedBuffers()
void
js::Nursery::waitBackgroundFreeEnd()
{
MOZ_ASSERT(freeMallocedBuffersTask);
freeMallocedBuffersTask->join();
}

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

@ -1318,6 +1318,10 @@ GCRuntime::init(uint32_t maxbytes, uint32_t maxNurseryBytes)
void
GCRuntime::finish()
{
/* Wait for the nursery sweeping to end. */
if (rt->gc.nursery.isEnabled())
rt->gc.nursery.waitBackgroundFreeEnd();
/*
* Wait until the background finalization and allocation stops and the
* helper thread shuts down before we forcefully release any remaining GC