- Add a SetPriority method to ThreadWrapper
- Remove 'priority' from CreateThread and related member variables from implementations
- Make supplying a name for threads, non-optional
BUG=
R=magjed@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/44729004
Cr-Commit-Position: refs/heads/master@{#8810}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8810 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_device/android/low_latency_event_unittest.cc b/webrtc/modules/audio_device/android/low_latency_event_unittest.cc
index 359625b..2138f1f 100644
--- a/webrtc/modules/audio_device/android/low_latency_event_unittest.cc
+++ b/webrtc/modules/audio_device/android/low_latency_event_unittest.cc
@@ -22,10 +22,8 @@
class LowLatencyEventTest : public testing::Test {
public:
LowLatencyEventTest()
- : process_thread_(ThreadWrapper::CreateThread(CbThread,
- this,
- kRealtimePriority,
- "test_thread")),
+ : process_thread_(ThreadWrapper::CreateThread(
+ CbThread, this, "test_thread")),
terminated_(false),
iteration_count_(0),
allowed_iterations_(0) {
@@ -46,6 +44,7 @@
private:
void Start() {
EXPECT_TRUE(process_thread_->Start());
+ process_thread_->SetPriority(kRealtimePriority);
}
void Stop() {
terminated_ = true;
diff --git a/webrtc/modules/audio_device/android/opensles_input.cc b/webrtc/modules/audio_device/android/opensles_input.cc
index f0e5347..12640e7 100644
--- a/webrtc/modules/audio_device/android/opensles_input.cc
+++ b/webrtc/modules/audio_device/android/opensles_input.cc
@@ -470,13 +470,14 @@
}
bool OpenSlesInput::StartCbThreads() {
- rec_thread_ = ThreadWrapper::CreateThread(CbThread, this, kRealtimePriority,
+ rec_thread_ = ThreadWrapper::CreateThread(CbThread, this,
"opensl_rec_thread");
assert(rec_thread_.get());
if (!rec_thread_->Start()) {
assert(false);
return false;
}
+ rec_thread_->SetPriority(kRealtimePriority);
OPENSL_RETURN_ON_FAILURE(
(*sles_recorder_itf_)->SetRecordState(sles_recorder_itf_,
SL_RECORDSTATE_RECORDING),
diff --git a/webrtc/modules/audio_device/android/opensles_output.cc b/webrtc/modules/audio_device/android/opensles_output.cc
index 350b5de..5782973 100644
--- a/webrtc/modules/audio_device/android/opensles_output.cc
+++ b/webrtc/modules/audio_device/android/opensles_output.cc
@@ -510,7 +510,7 @@
}
bool OpenSlesOutput::StartCbThreads() {
- play_thread_ = ThreadWrapper::CreateThread(CbThread, this, kRealtimePriority,
+ play_thread_ = ThreadWrapper::CreateThread(CbThread, this,
"opensl_play_thread");
assert(play_thread_.get());
OPENSL_RETURN_ON_FAILURE(
@@ -522,6 +522,7 @@
assert(false);
return false;
}
+ play_thread_->SetPriority(kRealtimePriority);
return true;
}