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

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

Issue 1175313002: Add ASSERT(isMainThread()) to WorkerThread::start() and ::terminate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: move into terminateInternal 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 | « no previous file | no next file » | 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 ee06a089949d8c1f193bb1558b17f2e439fa86d6..99bb64e04f4d6bb50823d8e15187a3ee5c7f20b3 100644
--- a/Source/core/workers/WorkerThread.cpp
+++ b/Source/core/workers/WorkerThread.cpp
@@ -177,6 +177,8 @@ WorkerThread::~WorkerThread()
void WorkerThread::start(PassOwnPtr<WorkerThreadStartupData> startupData)
{
+ ASSERT(isMainThread());
+
if (m_started)
return;
@@ -307,6 +309,8 @@ bool WorkerThread::terminated()
void WorkerThread::terminateInternal()
{
+ ASSERT(isMainThread());
+
// Protect against this method, initialize() or termination via the global scope racing each other.
MutexLocker lock(m_threadStateMutex);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698