talk_base: remove lock inversion between MessageQueue and MessageQueueManager.

Removes the concept of a MessageQueue being "active" in favor of considering all
live MQ's to be active.
(previously a MQ was active starting from the first Post to it and stopped being
active in its dtor).

BUG=3230
R=sriniv@google.com

Review URL: https://webrtc-codereview.appspot.com/21489004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6190 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org
2014-05-19 17:58:04 +00:00
parent cb711f77d2
commit 40bc7779aa
3 changed files with 6 additions and 23 deletions

View File

@@ -75,7 +75,7 @@ class MessageQueueManager {
void ClearInternal(MessageHandler *handler);
static MessageQueueManager* instance_;
// This list contains 'active' MessageQueues.
// This list contains all live MessageQueues.
std::vector<MessageQueue *> message_queues_;
CriticalSection crit_;
};
@@ -247,7 +247,6 @@ class MessageQueue {
void reheap() { make_heap(c.begin(), c.end(), comp); }
};
void EnsureActive();
void DoDelayPost(int cmsDelay, uint32 tstamp, MessageHandler *phandler,
uint32 id, MessageData* pdata);
@@ -258,9 +257,6 @@ class MessageQueue {
bool fStop_;
bool fPeekKeep_;
Message msgPeek_;
// A message queue is active if it has ever had a message posted to it.
// This also corresponds to being in MessageQueueManager's global list.
bool active_;
MessageList msgq_;
PriorityQueue dmsgq_;
uint32 dmsgq_next_num_;