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

Unified Diff: webrtc/base/messagequeue.cc

Issue 2828223002: Delete method MessageQueue::set_socketserver (Closed)
Patch Set: Delete redundant private: Created 3 years, 8 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/messagequeue.cc
diff --git a/webrtc/base/messagequeue.cc b/webrtc/base/messagequeue.cc
index efe618851a82086c5450dd3096684ee04477ee58..7622ef2d8efb7974282ddc9f5f049053d9dee9c0 100644
--- a/webrtc/base/messagequeue.cc
+++ b/webrtc/base/messagequeue.cc
@@ -146,8 +146,8 @@ void MessageQueueManager::ProcessAllMessageQueuesInternal() {
{
DebugNonReentrantCritScope cs(&crit_, &locked_);
for (MessageQueue* queue : message_queues_) {
- if (!queue->IsProcessingMessages()) {
- // If the queue is not processing messages, it can
+ if (!queue->IsProcessingMessages() || queue->empty()) {
Taylor Brandstetter 2017/04/28 02:59:34 Is the "|| queue->empty()" part still needed?
nisse-webrtc 2017/04/28 09:46:52 Unfortunately yes. Otherwise, rtc_unittests hangs
+ // If the queue is empty or not processing messages, it can
// be ignored. If we tried to post a message to it, it would be dropped
// or ignored.
continue;
@@ -216,30 +216,16 @@ void MessageQueue::DoDestroy() {
MessageQueueManager::Remove(this);
Clear(nullptr);
- SharedScope ss(&ss_lock_);
if (ss_) {
ss_->SetMessageQueue(nullptr);
}
}
SocketServer* MessageQueue::socketserver() {
- SharedScope ss(&ss_lock_);
return ss_;
}
-void MessageQueue::set_socketserver(SocketServer* ss) {
- // Need to lock exclusively here to prevent simultaneous modifications from
- // other threads. Can't be a shared lock to prevent races with other reading
- // threads.
- // Other places that only read "ss_" can use a shared lock as simultaneous
- // read access is allowed.
- ExclusiveScope es(&ss_lock_);
- ss_ = ss ? ss : own_ss_.get();
- ss_->SetMessageQueue(this);
-}
-
void MessageQueue::WakeUpSocketServer() {
- SharedScope ss(&ss_lock_);
ss_->WakeUp();
}
@@ -357,7 +343,6 @@ bool MessageQueue::Get(Message *pmsg, int cmsWait, bool process_io) {
{
// Wait and multiplex in the meantime
- SharedScope ss(&ss_lock_);
if (!ss_->Wait(static_cast<int>(cmsNext), process_io))
return false;
}

Powered by Google App Engine
This is Rietveld 408576698