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

Unified Diff: Source/web/WebKit.cpp

Issue 670683002: Terminate worker threads before detaching main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/core/Init.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebKit.cpp
diff --git a/Source/web/WebKit.cpp b/Source/web/WebKit.cpp
index 34fbaeb5d5ba7b163fa35f54a3cbc5eb9d9f0530..a6d8754f039f03651bf6d9c7c4ae1cc86cba318e 100644
--- a/Source/web/WebKit.cpp
+++ b/Source/web/WebKit.cpp
@@ -208,6 +208,11 @@ void shutdown()
v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate();
V8PerIsolateData::willBeDestroyed(isolate);
+ // Make sure we stop WorkerThreads before the main thread's ThreadState
+ // and later shutdown steps starts freeing up resources needed during
+ // worker termination.
+ WorkerThread::terminateAndWaitForAllWorkers();
+
// Detach the main thread before starting the shutdown sequence
// so that the main thread won't get involved in a GC during the shutdown.
ThreadState::detachMainThread();
« no previous file with comments | « Source/core/Init.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698