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

Unified Diff: runtime/vm/gc_sweeper.cc

Issue 1233563004: Avoid race in isolate shutdown; add assertions, error messages (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Move wait per suggestion; port to all platforms. Created 5 years, 5 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 | runtime/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/gc_sweeper.cc
diff --git a/runtime/vm/gc_sweeper.cc b/runtime/vm/gc_sweeper.cc
index 2b4ee58222014150a74493011907008f39c7a3e1..4cd224377b14c6ad084004ff16f48e6a541c358c 100644
--- a/runtime/vm/gc_sweeper.cc
+++ b/runtime/vm/gc_sweeper.cc
@@ -137,13 +137,14 @@ class SweeperTask : public ThreadPool::Task {
if (page == last_) break;
page = next_page;
}
+ // Exit isolate cleanly *before* notifying it, to avoid shutdown race.
+ Thread::ExitIsolateAsHelper();
// This sweeper task is done. Notify the original isolate.
{
MonitorLocker ml(old_space_->tasks_lock());
old_space_->set_tasks(old_space_->tasks() - 1);
ml.Notify();
}
- Thread::ExitIsolateAsHelper();
}
private:
« no previous file with comments | « no previous file | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698