Replace rtc::ThreadChecker with webrtc::SequenceChecker

Bug: webrtc:12419
Change-Id: I825c014cc1c4b1dcba5ef300409d44859e971144
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205002
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33136}
This commit is contained in:
Artem Titov
2021-02-02 10:57:19 +01:00
committed by Commit Bot
parent 7358b40f44
commit c8421c4c3e
94 changed files with 195 additions and 202 deletions

View File

@ -18,9 +18,9 @@
#include "modules/audio_device/audio_device_buffer.h"
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/message_handler.h"
#include "rtc_base/synchronization/sequence_checker.h"
#include "rtc_base/thread.h"
#include "rtc_base/thread_annotations.h"
#include "rtc_base/thread_checker.h"
#include "sdk/android/src/jni/audio_device/aaudio_wrapper.h"
#include "sdk/android/src/jni/audio_device/audio_device_module.h"
@ -99,12 +99,12 @@ class AAudioPlayer final : public AudioOutput,
// Ensures that methods are called from the same thread as this object is
// created on.
rtc::ThreadChecker main_thread_checker_;
SequenceChecker main_thread_checker_;
// Stores thread ID in first call to AAudioPlayer::OnDataCallback from a
// real-time thread owned by AAudio. Detached during construction of this
// object.
rtc::ThreadChecker thread_checker_aaudio_;
SequenceChecker thread_checker_aaudio_;
// The thread on which this object is created on.
rtc::Thread* main_thread_;

View File

@ -17,8 +17,8 @@
#include "modules/audio_device/audio_device_buffer.h"
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/message_handler.h"
#include "rtc_base/synchronization/sequence_checker.h"
#include "rtc_base/thread.h"
#include "rtc_base/thread_checker.h"
#include "sdk/android/src/jni/audio_device/aaudio_wrapper.h"
#include "sdk/android/src/jni/audio_device/audio_device_module.h"
@ -90,12 +90,12 @@ class AAudioRecorder : public AudioInput,
// Ensures that methods are called from the same thread as this object is
// created on.
rtc::ThreadChecker thread_checker_;
SequenceChecker thread_checker_;
// Stores thread ID in first call to AAudioPlayer::OnDataCallback from a
// real-time thread owned by AAudio. Detached during construction of this
// object.
rtc::ThreadChecker thread_checker_aaudio_;
SequenceChecker thread_checker_aaudio_;
// The thread on which this object is created on.
rtc::Thread* main_thread_;

View File

@ -14,7 +14,7 @@
#include <aaudio/AAudio.h>
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/thread_checker.h"
#include "rtc_base/synchronization/sequence_checker.h"
namespace webrtc {
@ -113,8 +113,8 @@ class AAudioWrapper {
bool VerifyStreamConfiguration();
bool OptimizeBuffers();
rtc::ThreadChecker thread_checker_;
rtc::ThreadChecker aaudio_thread_checker_;
SequenceChecker thread_checker_;
SequenceChecker aaudio_thread_checker_;
const AudioParameters audio_parameters_;
const aaudio_direction_t direction_;
AAudioObserverInterface* observer_ = nullptr;

View File

@ -19,7 +19,7 @@
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/ref_counted_object.h"
#include "rtc_base/thread_checker.h"
#include "rtc_base/synchronization/sequence_checker.h"
#include "sdk/android/generated_audio_device_module_base_jni/WebRtcAudioManager_jni.h"
#include "system_wrappers/include/metrics.h"
@ -583,7 +583,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
}
private:
rtc::ThreadChecker thread_checker_;
SequenceChecker thread_checker_;
const AudioDeviceModule::AudioLayer audio_layer_;
const bool is_stereo_playout_supported_;

View File

@ -16,7 +16,7 @@
#include "modules/audio_device/audio_device_buffer.h"
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/thread_checker.h"
#include "rtc_base/synchronization/sequence_checker.h"
#include "sdk/android/src/jni/audio_device/audio_device_module.h"
namespace webrtc {
@ -93,11 +93,11 @@ class AudioRecordJni : public AudioInput {
private:
// Stores thread ID in constructor.
rtc::ThreadChecker thread_checker_;
SequenceChecker thread_checker_;
// Stores thread ID in first call to OnDataIsRecorded() from high-priority
// thread in Java. Detached during construction of this object.
rtc::ThreadChecker thread_checker_java_;
SequenceChecker thread_checker_java_;
// Wraps the Java specific parts of the AudioRecordJni class.
JNIEnv* env_ = nullptr;

View File

@ -17,7 +17,7 @@
#include "absl/types/optional.h"
#include "modules/audio_device/audio_device_buffer.h"
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/thread_checker.h"
#include "rtc_base/synchronization/sequence_checker.h"
#include "sdk/android/src/jni/audio_device/audio_common.h"
#include "sdk/android/src/jni/audio_device/audio_device_module.h"
@ -84,11 +84,11 @@ class AudioTrackJni : public AudioOutput {
private:
// Stores thread ID in constructor.
rtc::ThreadChecker thread_checker_;
SequenceChecker thread_checker_;
// Stores thread ID in first call to OnGetPlayoutData() from high-priority
// thread in Java. Detached during construction of this object.
rtc::ThreadChecker thread_checker_java_;
SequenceChecker thread_checker_java_;
// Wraps the Java specific parts of the AudioTrackJni class.
JNIEnv* env_ = nullptr;

View File

@ -17,7 +17,7 @@
#include "api/ref_counted_base.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/thread_checker.h"
#include "rtc_base/synchronization/sequence_checker.h"
namespace webrtc {
@ -75,7 +75,7 @@ class OpenSLEngineManager : public rtc::RefCountedBase {
SLObjectItf GetOpenSLEngine();
private:
rtc::ThreadChecker thread_checker_;
SequenceChecker thread_checker_;
// This object is the global entry point of the OpenSL ES API.
// After creating the engine object, the application can obtain this object‘s
// SLEngineItf interface. This interface contains creation methods for all

View File

@ -21,7 +21,7 @@
#include "modules/audio_device/audio_device_buffer.h"
#include "modules/audio_device/fine_audio_buffer.h"
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/thread_checker.h"
#include "rtc_base/synchronization/sequence_checker.h"
#include "sdk/android/src/jni/audio_device/audio_common.h"
#include "sdk/android/src/jni/audio_device/audio_device_module.h"
#include "sdk/android/src/jni/audio_device/opensles_common.h"
@ -121,12 +121,12 @@ class OpenSLESPlayer : public AudioOutput {
// Ensures that methods are called from the same thread as this object is
// created on.
rtc::ThreadChecker thread_checker_;
SequenceChecker thread_checker_;
// Stores thread ID in first call to SimpleBufferQueueCallback() from internal
// non-application thread which is not attached to the Dalvik JVM.
// Detached during construction of this object.
rtc::ThreadChecker thread_checker_opensles_;
SequenceChecker thread_checker_opensles_;
const AudioParameters audio_parameters_;

View File

@ -21,7 +21,7 @@
#include "modules/audio_device/audio_device_buffer.h"
#include "modules/audio_device/fine_audio_buffer.h"
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/thread_checker.h"
#include "rtc_base/synchronization/sequence_checker.h"
#include "sdk/android/src/jni/audio_device/audio_common.h"
#include "sdk/android/src/jni/audio_device/audio_device_module.h"
#include "sdk/android/src/jni/audio_device/opensles_common.h"
@ -128,12 +128,12 @@ class OpenSLESRecorder : public AudioInput {
// Ensures that methods are called from the same thread as this object is
// created on.
rtc::ThreadChecker thread_checker_;
SequenceChecker thread_checker_;
// Stores thread ID in first call to SimpleBufferQueueCallback() from internal
// non-application thread which is not attached to the Dalvik JVM.
// Detached during construction of this object.
rtc::ThreadChecker thread_checker_opensles_;
SequenceChecker thread_checker_opensles_;
const AudioParameters audio_parameters_;

View File

@ -20,7 +20,7 @@
#include "common_video/h264/h264_bitstream_parser.h"
#include "rtc_base/race_checker.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/thread_checker.h"
#include "rtc_base/synchronization/sequence_checker.h"
#include "sdk/android/src/jni/jni_helpers.h"
namespace webrtc {
@ -83,7 +83,7 @@ class VideoDecoderWrapper : public VideoDecoder {
const ScopedJavaGlobalRef<jobject> decoder_;
const std::string implementation_name_;
rtc::ThreadChecker decoder_thread_checker_;
SequenceChecker decoder_thread_checker_;
// Callbacks must be executed sequentially on an arbitrary thread. We do not
// own this thread so a thread checker cannot be used.
rtc::RaceChecker callback_race_checker_;