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

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

Issue 1175233004: WorkerThread: drop unnecessary interfaces to simplify (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review #5 Created 5 years, 6 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/workers/WorkerThread.h ('k') | Source/web/WebEmbeddedWorkerImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerThread.cpp
diff --git a/Source/core/workers/WorkerThread.cpp b/Source/core/workers/WorkerThread.cpp
index 5b978216f06d3d5b2227c45d3326ae261822d8db..e666afe977985d528be90c86b3d5d1fbbfb82e5b 100644
--- a/Source/core/workers/WorkerThread.cpp
+++ b/Source/core/workers/WorkerThread.cpp
@@ -227,7 +227,7 @@ void WorkerThread::initialize(PassOwnPtr<WorkerThreadStartupData> startupData)
}
m_webScheduler = backingThread().platformThread().scheduler();
- // The corresponding call to stopRunLoop() is in ~WorkerScriptController().
+ // The corresponding call to didStopRunLoop() is in ~WorkerScriptController().
didStartRunLoop();
// Notify proxy that a new WorkerGlobalScope has been created and started.
@@ -285,17 +285,16 @@ void WorkerThread::shutdown()
m_terminationEvent->signal();
}
-
-void WorkerThread::stop()
+void WorkerThread::terminate()
{
- // Prevent the deadlock between GC and an attempt to stop a thread.
+ // Prevent the deadlock between GC and an attempt to terminate a thread.
SafePointScope safePointScope(ThreadState::HeapPointersOnStack);
- stopInternal();
+ terminateInternal();
}
void WorkerThread::terminateAndWait()
{
- stop();
+ terminate();
m_terminationEvent->wait();
}
@@ -305,12 +304,12 @@ bool WorkerThread::terminated()
return m_terminated;
}
-void WorkerThread::stopInternal()
+void WorkerThread::terminateInternal()
{
// Protect against this method, initialize() or termination via the global scope racing each other.
MutexLocker lock(m_threadStateMutex);
- // If stop has already been called, just return.
+ // If terminateInternal has already been called, just return.
if (m_terminated)
return;
m_terminated = true;
@@ -355,10 +354,10 @@ void WorkerThread::terminateAndWaitForAllWorkers()
MutexLocker lock(threadSetMutex());
HashSet<WorkerThread*> threads = workerThreads();
for (WorkerThread* thread : threads)
- thread->stopInternal();
+ thread->terminateInternal();
for (WorkerThread* thread : threads)
- thread->terminationEvent()->wait();
+ thread->m_terminationEvent->wait();
}
bool WorkerThread::isCurrentThread()
« no previous file with comments | « Source/core/workers/WorkerThread.h ('k') | Source/web/WebEmbeddedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698