commit | a28a91d2f00480c998112ceb47fa2ddca1a642c4 | [log] [tgz] |
---|---|---|
author | pbos@webrtc.org <pbos@webrtc.org> | Tue Feb 17 14:45:08 2015 +0000 |
committer | pbos@webrtc.org <pbos@webrtc.org> | Tue Feb 17 14:45:44 2015 +0000 |
tree | f25fb0d6aed3df2bb94320faedc0935839b772fd | |
parent | 8f605e89113ccdd02a5d68edf8e7a048ab0fdaff [diff] |
Fix data race for RTCPReceiver stats callback. Annotates the callback which identifies the bug, then fixes it. R=stefan@webrtc.org BUG= Review URL: https://webrtc-codereview.appspot.com/40009004 Cr-Commit-Position: refs/heads/master@{#8390} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8390 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc index 25a4756..62d6676 100644 --- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc +++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -770,6 +770,7 @@ cnameInfo->name[RTCP_CNAME_SIZE - 1] = 0; strncpy(cnameInfo->name, rtcpPacket.CName.CName, RTCP_CNAME_SIZE - 1); + CriticalSectionScoped lock(_criticalSectionFeedbacks); if (stats_callback_ != NULL) { stats_callback_->CNameChanged(rtcpPacket.CName.CName, rtcpPacket.CName.SenderSSRC);
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h index a52e810..46d10f7 100644 --- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h +++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.h
@@ -274,7 +274,7 @@ // delivered RTP packet to the remote side. int64_t _lastIncreasedSequenceNumberMs; - RtcpStatisticsCallback* stats_callback_; + RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks); RtcpPacketTypeCounter packet_type_counter_;