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() |