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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThread.cpp

Issue 2251903002: Destruct base::Thread before WorkerThread::terminateAndWait returns (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 4 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
Index: third_party/WebKit/Source/core/workers/WorkerThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index 8b7022d3a76fc3ebc41a1b27fa30e761d8ca852d..a9489c91d90c146687d9edbb7278740e524378f0 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -215,6 +215,9 @@ void WorkerThread::terminateAndWait()
// not work.
terminateInternal(TerminationMode::Forcible);
m_shutdownEvent->wait();
+
+ // Destruct base::Thread and join the underlying system thread.
+ clearWorkerBackingThread();
}
void WorkerThread::terminateAndWaitForAllWorkers()
@@ -232,6 +235,10 @@ void WorkerThread::terminateAndWaitForAllWorkers()
for (WorkerThread* thread : threads)
thread->m_shutdownEvent->wait();
+
+ // Destruct base::Thread and join the underlying system threads.
+ for (WorkerThread* thread : threads)
+ thread->clearWorkerBackingThread();
}
v8::Isolate* WorkerThread::isolate()
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.h ('k') | third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698