Remove potential deadlock in WebRtcVideoEngine2.

Fixes lock-order inversions between capturer's SignalVideoFrame and
WebRtcVideoSendStream. Additionally also removes all deadlock
suppressions for WebRtcVideoEngine2.

R=stefan@webrtc.org
TBR=kjellander@webrtc.org
BUG=1788,2999

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7386 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2014-10-07 14:27:27 +00:00
parent a9e363e721
commit 963b979510
2 changed files with 9 additions and 7 deletions

View File

@ -1481,12 +1481,16 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::MuteStream(bool mute) {
} }
bool WebRtcVideoChannel2::WebRtcVideoSendStream::DisconnectCapturer() { bool WebRtcVideoChannel2::WebRtcVideoSendStream::DisconnectCapturer() {
cricket::VideoCapturer* capturer;
{
rtc::CritScope cs(&lock_); rtc::CritScope cs(&lock_);
if (capturer_ == NULL) { if (capturer_ == NULL) {
return false; return false;
} }
capturer_->SignalVideoFrame.disconnect(this); capturer = capturer_;
capturer_ = NULL; capturer_ = NULL;
}
capturer->SignalVideoFrame.disconnect(this);
return true; return true;
} }

View File

@ -59,8 +59,6 @@ char kTSanDefaultSuppressions[] =
// Potential deadlocks detected after roll in r6516. // Potential deadlocks detected after roll in r6516.
// https://code.google.com/p/webrtc/issues/detail?id=3509 // https://code.google.com/p/webrtc/issues/detail?id=3509
"deadlock:cricket::WebRtcVideoChannel2::WebRtcVideoSendStream::InputFrame\n"
"deadlock:cricket::WebRtcVideoChannel2::WebRtcVideoSendStream::SetCapturer\n"
"deadlock:webrtc::ProcessThreadImpl::RegisterModule\n" "deadlock:webrtc::ProcessThreadImpl::RegisterModule\n"
"deadlock:webrtc::RTCPReceiver::SetSsrcs\n" "deadlock:webrtc::RTCPReceiver::SetSsrcs\n"
"deadlock:webrtc::RTPSenderAudio::RegisterAudioPayload\n" "deadlock:webrtc::RTPSenderAudio::RegisterAudioPayload\n"