From 44b1fa43be3b398ba8ca9f59b877e5f9eb1180a6 Mon Sep 17 00:00:00 2001 From: Elad Alon Date: Tue, 17 Oct 2017 14:17:54 +0200 Subject: [PATCH] Missing use of RTC_GUARDED_BY in PacedSender PacedSender::probing_send_failure_ and PacedSender::packet_counter_ should probably also be protected by the critical section. (This isn't the cause of webrtc:8331.) TBR=stefan@webrtc.org Bug: webrtc:8331 Change-Id: I94ebe77341137aa511c736d18a63e3e8ec0d1bac Reviewed-on: https://webrtc-review.googlesource.com/12220 Commit-Queue: Elad Alon Reviewed-by: Fredrik Solenberg Cr-Commit-Position: refs/heads/master@{#20324} --- modules/pacing/paced_sender.cc | 2 +- modules/pacing/paced_sender.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/pacing/paced_sender.cc b/modules/pacing/paced_sender.cc index fc6a9f0f9b..e6b781ef16 100644 --- a/modules/pacing/paced_sender.cc +++ b/modules/pacing/paced_sender.cc @@ -102,8 +102,8 @@ void PacedSender::Resume() { } void PacedSender::SetProbingEnabled(bool enabled) { - RTC_CHECK_EQ(0, packet_counter_); rtc::CritScope cs(&critsect_); + RTC_CHECK_EQ(0, packet_counter_); prober_->SetEnabled(enabled); } diff --git a/modules/pacing/paced_sender.h b/modules/pacing/paced_sender.h index 499f1d90ae..458efb4ff2 100644 --- a/modules/pacing/paced_sender.h +++ b/modules/pacing/paced_sender.h @@ -173,7 +173,7 @@ class PacedSender : public Pacer { std::unique_ptr padding_budget_ RTC_GUARDED_BY(critsect_); std::unique_ptr prober_ RTC_GUARDED_BY(critsect_); - bool probing_send_failure_; + bool probing_send_failure_ RTC_GUARDED_BY(critsect_); // Actual configured bitrates (media_budget_ may temporarily be higher in // order to meet pace time constraint). uint32_t estimated_bitrate_bps_ RTC_GUARDED_BY(critsect_); @@ -185,7 +185,7 @@ class PacedSender : public Pacer { int64_t first_sent_packet_ms_ RTC_GUARDED_BY(critsect_); std::unique_ptr packets_ RTC_GUARDED_BY(critsect_); - uint64_t packet_counter_; + uint64_t packet_counter_ RTC_GUARDED_BY(critsect_); ProcessThread* process_thread_ = nullptr; float pacing_factor_ RTC_GUARDED_BY(critsect_);