Index: Source/core/workers/WorkerThread.cpp |
diff --git a/Source/core/workers/WorkerThread.cpp b/Source/core/workers/WorkerThread.cpp |
index f59a49182a66ff3dcd4b57653f081d209767d181..8679bc071b18915b966013409b89b160f95d1d22 100644 |
--- a/Source/core/workers/WorkerThread.cpp |
+++ b/Source/core/workers/WorkerThread.cpp |
@@ -265,6 +265,7 @@ WorkerThread::WorkerThread(const char* threadName, PassRefPtr<WorkerLoaderProxy> |
, m_isolate(nullptr) |
, m_shutdownEvent(adoptPtr(blink::Platform::current()->createWaitableEvent())) |
, m_terminationEvent(adoptPtr(blink::Platform::current()->createWaitableEvent())) |
+ , m_thread(nullptr) |
{ |
MutexLocker lock(threadSetMutex()); |
workerThreads().add(this); |
@@ -281,8 +282,11 @@ void WorkerThread::start() |
{ |
if (m_thread) |
return; |
- |
- m_thread = createWebThreadSupportingGC(); |
+ m_thread = m_startupData->m_thread; |
+ if (!m_thread) { |
+ m_ownThread = createWebThreadSupportingGC(); |
+ m_thread = m_ownThread.get(); |
+ } |
m_thread->postTask(FROM_HERE, new Task(threadSafeBind(&WorkerThread::initialize, AllowCrossThreadAccess(this)))); |
} |