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

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

Issue 2164873002: [Merge to M53] Worker: Remove locking from WorkerThread::postTask() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 a9ae4f9f1849f2bcf9ebfe1b2965c690a0b7bfaf..0e2821a5ab395898fd90ab3d60ad687a2462f6d2 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.h
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.h
@@ -194,6 +194,12 @@ private:
void terminateInternal(TerminationMode);
void forciblyTerminateExecution();
+ // Returns true if termination or shutdown sequence has started. This is
+ // thread safe.
+ // Note that this returns false when the sequence has already started but it
+ // hasn't been notified to the calling thread.
+ bool isInShutdown();
+
void initializeOnWorkerThread(std::unique_ptr<WorkerThreadStartupData>);
void prepareForShutdownOnWorkerThread();
void performShutdownOnWorkerThread();
@@ -201,11 +207,21 @@ private:
void performDebuggerTaskOnWorkerThread(std::unique_ptr<CrossThreadClosure>);
void performDebuggerTaskDontWaitOnWorkerThread();
+ // Accessed only on the main thread.
bool m_started = false;
+
+ // Set on the main thread and checked on both the main and worker threads.
bool m_terminated = false;
+
+ // Set on the worker thread and checked on both the main and worker threads.
bool m_readyToShutdown = false;
+
+ // 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;
+
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