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

Unified Diff: webrtc/base/thread.cc

Issue 2023193002: Protect MessageQueue stop field with a critical section to avoid data races. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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
Index: webrtc/base/thread.cc
diff --git a/webrtc/base/thread.cc b/webrtc/base/thread.cc
index c6dc3c45a03c9a37bd183ae3e82df01fd55c9369..07e42f86c11fed90eacdba3526dbf5a075b52b0d 100644
--- a/webrtc/base/thread.cc
+++ b/webrtc/base/thread.cc
@@ -219,7 +219,7 @@ bool Thread::Start(Runnable* runnable) {
ASSERT(!running());
if (running()) return false;
- Restart(); // reset fStop_ if the thread is being restarted
+ Restart(); // reset IsQuitting() if the thread is being restarted
// Make sure that ThreadManager is created on the main thread before
// we start a new thread.
@@ -344,7 +344,7 @@ void Thread::Stop() {
}
void Thread::Send(MessageHandler* phandler, uint32_t id, MessageData* pdata) {
- if (fStop_)
+ if (IsQuitting())
return;
// Sent messages are sent to the MessageHandler directly, in the context

Powered by Google App Engine
This is Rietveld 408576698