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

Side by Side Diff: runtime/vm/dart.cc

Issue 1030013002: Shutdown the service isolate when shutting down the VM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/dart.h" 5 #include "vm/dart.h"
6 6
7 #include "vm/code_observers.h" 7 #include "vm/code_observers.h"
8 #include "vm/cpu.h" 8 #include "vm/cpu.h"
9 #include "vm/dart_api_state.h" 9 #include "vm/dart_api_state.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 Isolate::SetUnhandledExceptionCallback(unhandled); 151 Isolate::SetUnhandledExceptionCallback(unhandled);
152 Isolate::SetShutdownCallback(shutdown); 152 Isolate::SetShutdownCallback(shutdown);
153 153
154 ServiceIsolate::Run(); 154 ServiceIsolate::Run();
155 155
156 return NULL; 156 return NULL;
157 } 157 }
158 158
159 159
160 const char* Dart::Cleanup() { 160 const char* Dart::Cleanup() {
161 // Shutdown the service isolate before shutting down the thread pool.
162 ServiceIsolate::Shutdown();
161 #if 0 163 #if 0
162 // Ideally we should shutdown the VM isolate here, but the thread pool 164 // Ideally we should shutdown the VM isolate here, but the thread pool
163 // shutdown does not seem to ensure that all the threads have stopped 165 // shutdown does not seem to ensure that all the threads have stopped
164 // execution before it terminates, this results in racing isolates. 166 // execution before it terminates, this results in racing isolates.
165 if (vm_isolate_ == NULL) { 167 if (vm_isolate_ == NULL) {
166 return "VM already terminated."; 168 return "VM already terminated.";
167 } 169 }
168 170
169 ASSERT(Isolate::Current() == NULL); 171 ASSERT(Isolate::Current() == NULL);
170 172
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 return predefined_handles_->handles_.AllocateScopedHandle(); 312 return predefined_handles_->handles_.AllocateScopedHandle();
311 } 313 }
312 314
313 315
314 bool Dart::IsReadOnlyHandle(uword address) { 316 bool Dart::IsReadOnlyHandle(uword address) {
315 ASSERT(predefined_handles_ != NULL); 317 ASSERT(predefined_handles_ != NULL);
316 return predefined_handles_->handles_.IsValidScopedHandle(address); 318 return predefined_handles_->handles_.IsValidScopedHandle(address);
317 } 319 }
318 320
319 } // namespace dart 321 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698