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

Unified Diff: runtime/vm/pages.cc

Issue 480343003: - Address review comments from https://codereview.chromium.org/474913004/ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 | « runtime/vm/message_handler.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
===================================================================
--- runtime/vm/pages.cc (revision 39411)
+++ runtime/vm/pages.cc (working copy)
@@ -139,7 +139,9 @@
PageSpace::~PageSpace() {
{
MonitorLocker ml(tasks_lock());
- ASSERT(tasks() == 0);
+ while (tasks() > 0) {
+ ml.Wait();
+ }
}
FreePages(pages_);
FreePages(large_pages_);
@@ -522,7 +524,7 @@
// Wait for pending tasks to complete and then account for the driver task.
{
MonitorLocker locker(tasks_lock());
- while (tasks() != 0) {
+ while (tasks() > 0) {
locker.Wait();
}
set_tasks(1);
@@ -636,9 +638,10 @@
// Done, reset the task count.
{
- MonitorLocker locker(tasks_lock());
+ MonitorLocker ml(tasks_lock());
ASSERT(tasks() == 1);
set_tasks(tasks() - 1);
+ ml.Notify();
}
}
« no previous file with comments | « runtime/vm/message_handler.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698