Disable CS_TRACK_OWNER on Mac in debug mode.

Local testing indicates that the pthread_t member variable might be causing alignment problems on the Chromium bots.  After landing this (and once the Chromium tree is open again), I'll try a roll again to see if this has an effect.

R=magjed@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8644}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8644 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tommi@webrtc.org 2015-03-07 20:14:50 +00:00
parent f696e49c9a
commit 679d2f1352
2 changed files with 12 additions and 0 deletions

View File

@ -44,7 +44,13 @@
#endif
#ifdef _DEBUG
#if defined(WEBRTC_MAC)
// TODO(tommi): This is related to the comment above. It looks like the
// pthread_t member might be throwing off the mac debug bots (10.9).
#define CS_TRACK_OWNER 0
#else
#define CS_TRACK_OWNER 1
#endif
#endif // _DEBUG
#if CS_TRACK_OWNER

View File

@ -59,7 +59,9 @@ void MessageQueueManager::AddInternal(MessageQueue *message_queue) {
// MessageQueueManager methods should be non-reentrant, so we
// ASSERT that is the case. If any of these ASSERT, please
// contact bpm or jbeda.
#if CS_TRACK_OWNER // CurrentThreadIsOwner returns true by default.
ASSERT(!crit_.CurrentThreadIsOwner());
#endif
CritScope cs(&crit_);
message_queues_.push_back(message_queue);
}
@ -71,7 +73,9 @@ void MessageQueueManager::Remove(MessageQueue *message_queue) {
return Instance()->RemoveInternal(message_queue);
}
void MessageQueueManager::RemoveInternal(MessageQueue *message_queue) {
#if CS_TRACK_OWNER // CurrentThreadIsOwner returns true by default.
ASSERT(!crit_.CurrentThreadIsOwner()); // See note above.
#endif
// If this is the last MessageQueue, destroy the manager as well so that
// we don't leak this object at program shutdown. As mentioned above, this is
// not thread-safe, but this should only happen at program termination (when
@ -100,7 +104,9 @@ void MessageQueueManager::Clear(MessageHandler *handler) {
return Instance()->ClearInternal(handler);
}
void MessageQueueManager::ClearInternal(MessageHandler *handler) {
#if CS_TRACK_OWNER // CurrentThreadIsOwner returns true by default.
ASSERT(!crit_.CurrentThreadIsOwner()); // See note above.
#endif
CritScope cs(&crit_);
std::vector<MessageQueue *>::iterator iter;
for (iter = message_queues_.begin(); iter != message_queues_.end(); iter++)