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

Unified Diff: runtime/vm/service_isolate.cc

Issue 1275353005: VM thread shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 5 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
Index: runtime/vm/service_isolate.cc
diff --git a/runtime/vm/service_isolate.cc b/runtime/vm/service_isolate.cc
index 3779905093b7a5a401698fb608fec912ad4e4669..5bf703e76bd125c512b1e6eef29be515c456a398 100644
--- a/runtime/vm/service_isolate.cc
+++ b/runtime/vm/service_isolate.cc
@@ -749,8 +749,30 @@ void ServiceIsolate::Run() {
}
+void ServiceIsolate::KillServiceIsolate() {
+ {
+ MonitorLocker ml(monitor_);
+ shutting_down_ = true;
+ }
+ isolate_->Kill();
Ivan Posva 2015/08/19 08:31:06 Need to make sure we own the isolate list lock whe
zra 2015/08/25 18:19:30 Added static KillIfExists to Isolate. It uses the
+ {
+ MonitorLocker ml(monitor_);
+ while (shutting_down_) {
+ ml.Wait();
+ }
+ }
+}
+
+
void ServiceIsolate::Shutdown() {
if (!IsRunning()) {
+ if (isolate_ != NULL) {
+ // TODO(johnmccutchan,turnidge) When it is possible to properly create
+ // the VMService object and set up its shutdown handler in the service
+ // isolate's main() function, this case will no longer be possible and
+ // can be removed.
+ KillServiceIsolate();
+ }
return;
}
{
« runtime/vm/isolate.cc ('K') | « runtime/vm/service_isolate.h ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698