Chromium Code Reviews| 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; |
| } |
| { |