Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: src/heap/mark-compact.cc

Issue 2047013004: [heap] Fix Sweeper::IsSweepingCompleted (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 5c2c012f04f7d32386eb085405d1185a8e8e9df0..b6466b9066513fd6e4d0b2219dbd5b8f1a55079e 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -583,12 +583,12 @@ void MarkCompactCollector::EnsureSweepingCompleted() {
}
bool MarkCompactCollector::Sweeper::IsSweepingCompleted() {
- if (!pending_sweeper_tasks_semaphore_.WaitFor(
- base::TimeDelta::FromSeconds(0))) {
- return false;
+ while ((num_sweeping_tasks_ > 0) &&
+ pending_sweeper_tasks_semaphore_.WaitFor(
+ base::TimeDelta::FromSeconds(0))) {
+ num_sweeping_tasks_--;
}
- pending_sweeper_tasks_semaphore_.Signal();
- return true;
+ return num_sweeping_tasks_ == 0;
}
void Marking::TransferMark(Heap* heap, Address old_start, Address new_start) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698