Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(919)

Unified Diff: webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
diff --git a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
index 7970ef7c79791c45fdef4b648109a4ad9a937649..42c3ea82954ebb04eeac0ff9e2b17e5aa2ce37c4 100644
--- a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
+++ b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
@@ -200,33 +200,17 @@ int32_t AudioDeviceLinuxPulse::Init()
}
// RECORDING
- const char* threadName = "webrtc_audio_module_rec_thread";
- _ptrThreadRec =
- PlatformThread::CreateThread(RecThreadFunc, this, threadName);
- if (!_ptrThreadRec->Start())
- {
- WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
- " failed to start the rec audio thread");
-
- _ptrThreadRec.reset();
- return -1;
- }
+ _ptrThreadRec.reset(new rtc::PlatformThread(
+ RecThreadFunc, this, "webrtc_audio_module_rec_thread"));
- _ptrThreadRec->SetPriority(kRealtimePriority);
+ _ptrThreadRec->Start();
+ _ptrThreadRec->SetPriority(rtc::kRealtimePriority);
// PLAYOUT
- threadName = "webrtc_audio_module_play_thread";
- _ptrThreadPlay =
- PlatformThread::CreateThread(PlayThreadFunc, this, threadName);
- if (!_ptrThreadPlay->Start())
- {
- WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
- " failed to start the play audio thread");
-
- _ptrThreadPlay.reset();
- return -1;
- }
- _ptrThreadPlay->SetPriority(kRealtimePriority);
+ _ptrThreadPlay.reset(new rtc::PlatformThread(
+ PlayThreadFunc, this, "webrtc_audio_module_play_thread"));
+ _ptrThreadPlay->Start();
+ _ptrThreadPlay->SetPriority(rtc::kRealtimePriority);
_initialized = true;
@@ -246,7 +230,7 @@ int32_t AudioDeviceLinuxPulse::Terminate()
// RECORDING
if (_ptrThreadRec)
{
- PlatformThread* tmpThread = _ptrThreadRec.release();
+ rtc::PlatformThread* tmpThread = _ptrThreadRec.release();
_timeEventRec.Set();
tmpThread->Stop();
@@ -256,7 +240,7 @@ int32_t AudioDeviceLinuxPulse::Terminate()
// PLAYOUT
if (_ptrThreadPlay)
{
- PlatformThread* tmpThread = _ptrThreadPlay.release();
+ rtc::PlatformThread* tmpThread = _ptrThreadPlay.release();
_timeEventPlay.Set();
tmpThread->Stop();
« no previous file with comments | « webrtc/modules/audio_device/linux/audio_device_pulse_linux.h ('k') | webrtc/modules/audio_device/mac/audio_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698