[heap] Fix waiting for parallel tasks
authormlippautz <mlippautz@chromium.org>
Thu, 17 Sep 2015 14:43:15 +0000 (07:43 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 17 Sep 2015 14:43:27 +0000 (14:43 +0000)
R=hpayer@chromium.org
BUG=chromium:524425
LOG=N

Review URL: https://codereview.chromium.org/1356663002

Cr-Commit-Position: refs/heads/master@{#30803}

src/heap/mark-compact.cc

index e241fc7bf0ea9a4bcfdad0a284d8857479974a6d..9f5ac52028ae2bda5a16c8cb8d2c62adb03a821c 100644 (file)
@@ -3467,8 +3467,9 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
 
 
 void MarkCompactCollector::WaitUntilCompactionCompleted() {
-  while (concurrent_compaction_tasks_active_-- > 0) {
+  while (concurrent_compaction_tasks_active_ > 0) {
     pending_compaction_tasks_semaphore_.Wait();
+    concurrent_compaction_tasks_active_--;
   }
   parallel_compaction_in_progress_ = false;
 }