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

Unified Diff: webrtc/base/thread.cc

Issue 1666863002: Fix race between Thread ctor/dtor and MessageQueueManager registrations. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Reverted PS #7, updated comments Created 4 years, 10 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 | « webrtc/base/thread.h ('k') | webrtc/base/thread_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/thread.cc
diff --git a/webrtc/base/thread.cc b/webrtc/base/thread.cc
index 4197d28175a05037f5ad953aba64d6b72ae62bef..cda4ba475c8b6bfebd80fe994c518f4b55d3e666 100644
--- a/webrtc/base/thread.cc
+++ b/webrtc/base/thread.cc
@@ -138,8 +138,8 @@ Thread::ScopedDisallowBlockingCalls::~ScopedDisallowBlockingCalls() {
thread_->SetAllowBlockingCalls(previous_state_);
}
-Thread::Thread(SocketServer* ss)
- : MessageQueue(ss),
+Thread::Thread(SocketServer* ss, bool init_queue)
+ : MessageQueue(ss, false),
running_(true, false),
#if defined(WEBRTC_WIN)
thread_(NULL),
@@ -148,11 +148,14 @@ Thread::Thread(SocketServer* ss)
owned_(true),
blocking_calls_allowed_(true) {
SetName("Thread", this); // default name
+ if (init_queue) {
+ DoInit();
+ }
}
Thread::~Thread() {
Stop();
- Clear(NULL);
+ DoDestroy();
}
bool Thread::SleepMs(int milliseconds) {
« no previous file with comments | « webrtc/base/thread.h ('k') | webrtc/base/thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698