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

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

Issue 2280523002: Worker: Unify worker thread shutdown sequence (Closed)
Patch Set: tweak Created 4 years, 3 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 | third_party/WebKit/Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/WorkerThread.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.h b/third_party/WebKit/Source/core/workers/WorkerThread.h
index ea3079a2a44d9fe2c9389134bbf08f211efcafca..e77aa9688b9984d2e8239d6329e592e53bf64470 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.h
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.h
@@ -225,6 +225,11 @@ private:
void setExitCode(const MutexLocker&, ExitCode);
bool isThreadStateMutexLocked(const MutexLocker&);
+ // This internally acquires |m_threadStateMutex|. If you already have the
+ // lock or you're on the main thread, you should consider directly accessing
+ // |m_requestedToTerminate|.
+ bool checkRequestedToTerminateOnWorkerThread();
+
ExitCode getExitCodeForTesting();
// Accessed only on the main thread.
@@ -233,14 +238,13 @@ private:
// Set on the main thread and checked on both the main and worker threads.
bool m_requestedToTerminate = false;
- ThreadState m_threadState = ThreadState::NotStarted;
-
// Accessed only on the worker thread.
bool m_pausedInDebugger = false;
// Set on the worker thread and checked on both the main and worker threads.
bool m_runningDebuggerTask = false;
+ ThreadState m_threadState = ThreadState::NotStarted;
ExitCode m_exitCode = ExitCode::NotTerminated;
long long m_forceTerminationDelayInMs;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698