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

Unified Diff: runtime/vm/dart.cc

Issue 1555643002: Thread fixes for shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address 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 | « no previous file | runtime/vm/os_thread.cc » ('j') | runtime/vm/os_thread.cc » ('J')
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 024f6530f8bf8dd1d6cfc6635ac8f134c82e403a..96dc5986e72bae70741b1dab41c73609d28e8544 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -222,10 +222,6 @@ 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();
@@ -252,6 +248,11 @@ const char* Dart::Cleanup() {
// before shutting down the thread pool.
WaitForIsolateShutdown();
+ // Disable creation of any new OSThread structures which means no more new
+ // threads can do an EnterIsolate. This must come after isolate shutdown
+ // because new threads may need to be spawned to shutdown the isolates.
+ OSThread::DisableOSThreadCreation();
+
// Shutdown the thread pool. On return, all thread pool threads have exited.
delete thread_pool_;
thread_pool_ = NULL;
@@ -276,6 +277,9 @@ const char* Dart::Cleanup() {
} else {
// Shutdown the service isolate.
ServiceIsolate::Shutdown();
+
+ // Disable thread creation.
+ OSThread::DisableOSThreadCreation();
}
CodeObservers::DeleteAll();
« no previous file with comments | « no previous file | runtime/vm/os_thread.cc » ('j') | runtime/vm/os_thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698