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

Unified Diff: runtime/vm/dart.cc

Issue 1537543002: Fix for issue 25236 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 5 years 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/compiler.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart.cc
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 75689247de36c62c526e186d9aea4ec9f742e5ce..024f6530f8bf8dd1d6cfc6635ac8f134c82e403a 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -222,13 +222,18 @@ const char* Dart::Cleanup() {
return "VM already terminated.";
}
+ // Disable creation of any new OSThread structures which means no more new
+ // threads can do an EnterIsolate.
+ OSThread::DisableOSThreadCreation();
+
// Shut down profiling.
Profiler::Shutdown();
{
// Set the VM isolate as current isolate when shutting down
// Metrics so that we can use a StackZone.
- Thread::EnterIsolate(vm_isolate_);
+ bool result = Thread::EnterIsolate(vm_isolate_);
+ ASSERT(result);
Metric::Cleanup();
Thread::ExitIsolate();
}
@@ -252,7 +257,8 @@ const char* Dart::Cleanup() {
thread_pool_ = NULL;
// Set the VM isolate as current isolate.
- Thread::EnterIsolate(vm_isolate_);
+ bool result = Thread::EnterIsolate(vm_isolate_);
+ ASSERT(result);
ShutdownIsolate();
vm_isolate_ = NULL;
@@ -407,7 +413,8 @@ void Dart::RunShutdownCallback() {
void Dart::ShutdownIsolate(Isolate* isolate) {
ASSERT(Isolate::Current() == NULL);
// We need to enter the isolate in order to shut it down.
- Thread::EnterIsolate(isolate);
+ bool result = Thread::EnterIsolate(isolate);
+ ASSERT(result);
ShutdownIsolate();
// Since the isolate is shutdown and deleted, there is no need to
// exit the isolate here.
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698