Index: runtime/vm/object_graph.cc |
diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc |
index 773839dd16be356ec2be5035b7198de8c85c25ac..f50046896face8357917abecee537691a61c7f61 100644 |
--- a/runtime/vm/object_graph.cc |
+++ b/runtime/vm/object_graph.cc |
@@ -147,6 +147,11 @@ class Unmarker : public ObjectVisitor { |
} |
static void UnmarkAll(Isolate* isolate) { |
+ PageSpace* old_space = isolate->heap()->old_space(); |
+ MonitorLocker ml(old_space->tasks_lock()); |
+ while (old_space->tasks() > 0) { |
+ ml.Wait(); |
+ } |
Unmarker unmarker(isolate); |
isolate->heap()->VisitObjects(&unmarker); |
} |