Bug 1288579 - Fix hang when GC is decommitting. r=terrence, a=ritu
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 24 Aug 2016 10:13:58 +0100
changeset 333043 0baff3de0d576e482c2e88318029f367f77448c1
parent 333042 ff1e5019f0c9071165e4a19a65217f807d5267df
child 333044 68613c98775b2221a6687f9b34bb28c029533056
push id9980
push usertcole@mozilla.com
push dateFri, 02 Sep 2016 17:34:59 +0000
treeherdermozilla-aurora@0baff3de0d57 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence, ritu
bugs1288579
milestone50.0a2
Bug 1288579 - Fix hang when GC is decommitting. r=terrence, a=ritu
js/src/gc/Allocator.cpp
--- a/js/src/gc/Allocator.cpp
+++ b/js/src/gc/Allocator.cpp
@@ -328,18 +328,20 @@ GCRuntime::refillFreeListOffMainThread(E
     JSRuntime* rt = zone->runtimeFromAnyThread();
 
     AutoMaybeStartBackgroundAllocation maybeStartBGAlloc;
 
     // If we're off the main thread, we try to allocate once and return
     // whatever value we get. We need to first ensure the main thread is not in
     // a GC session.
     AutoLockHelperThreadState lock;
-    while (rt->isHeapBusy())
+    while (rt->isHeapBusy()) {
         HelperThreadState().wait(lock, GlobalHelperThreadState::PRODUCER);
+        HelperThreadState().notifyOne(GlobalHelperThreadState::PRODUCER);
+    }
 
     return arenas->allocateFromArena(zone, thingKind, maybeStartBGAlloc);
 }
 
 /* static */ TenuredCell*
 GCRuntime::refillFreeListInGC(Zone* zone, AllocKind thingKind)
 {
     /*