Adding critsect for child_modules_ in ModuleRtpRtcpImpl::Process() to avoid race with ModuleRtpRtcp::RegisterChildModule.

Found with tsan.

TEST=try job and tsan
R=holmer@google.com

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4661 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org 2013-09-03 12:11:12 +00:00
parent cb5118c14c
commit cac7325b84

View File

@ -196,7 +196,12 @@ int32_t ModuleRtpRtcpImpl::Process() {
last_bitrate_process_time_ = now;
}
const bool default_instance(child_modules_.empty() ? false : true);
bool default_instance = false;
{
CriticalSectionScoped cs(critical_section_module_ptrs_.get());
if (!child_modules_.empty())
default_instance = true;
}
if (!default_instance) {
if (rtcp_sender_.Sending()) {
// Process RTT if we have received a receiver report and we haven't