From 541280a8ca21033b495c3a1c543049f60dd2febe Mon Sep 17 00:00:00 2001 From: "henrik.lundin" Date: Thu, 10 Aug 2017 05:01:21 -0700 Subject: [PATCH] Add thread annotations to AudioLevel This is a follow-up to https://codereview.webrtc.org/2984473002/. BUG=none TBR=henrika@webrtc.org Review-Url: https://codereview.webrtc.org/2998763002 Cr-Commit-Position: refs/heads/master@{#19306} --- webrtc/voice_engine/audio_level.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/webrtc/voice_engine/audio_level.h b/webrtc/voice_engine/audio_level.h index caecf40689..d69365afb6 100644 --- a/webrtc/voice_engine/audio_level.h +++ b/webrtc/voice_engine/audio_level.h @@ -12,6 +12,7 @@ #define WEBRTC_VOICE_ENGINE_AUDIO_LEVEL_H_ #include "webrtc/rtc_base/criticalsection.h" +#include "webrtc/rtc_base/thread_annotations.h" #include "webrtc/typedefs.h" namespace webrtc { @@ -44,13 +45,13 @@ class AudioLevel { rtc::CriticalSection crit_sect_; - int16_t abs_max_; - int16_t count_; - int8_t current_level_; - int16_t current_level_full_range_; + int16_t abs_max_ GUARDED_BY(crit_sect_); + int16_t count_ GUARDED_BY(crit_sect_); + int8_t current_level_ GUARDED_BY(crit_sect_); + int16_t current_level_full_range_ GUARDED_BY(crit_sect_); - double total_energy_ = 0.0; - double total_duration_ = 0.0; + double total_energy_ GUARDED_BY(crit_sect_) = 0.0; + double total_duration_ GUARDED_BY(crit_sect_) = 0.0; }; } // namespace voe