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

Unified Diff: media/audio/audio_device_thread.cc

Issue 12741012: base: Support setting thread priorities generically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 7 months 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: media/audio/audio_device_thread.cc
diff --git a/media/audio/audio_device_thread.cc b/media/audio/audio_device_thread.cc
index 7583c9ed91218d73a21c920ee2463e7fbe421858..3d47e0939a31c85427e4403dcc202efaf6c633da 100644
--- a/media/audio/audio_device_thread.cc
+++ b/media/audio/audio_device_thread.cc
@@ -101,18 +101,18 @@ AudioDeviceThread::Thread::Thread(AudioDeviceThread::Callback* callback,
}
AudioDeviceThread::Thread::~Thread() {
- DCHECK_EQ(thread_, base::kNullThreadHandle) << "Stop wasn't called";
+ DCHECK(thread_.isNull());
}
void AudioDeviceThread::Thread::Start() {
base::AutoLock auto_lock(callback_lock_);
- DCHECK_EQ(thread_, base::kNullThreadHandle);
+ DCHECK(thread_.isNull());
// This reference will be released when the thread exists.
AddRef();
PlatformThread::CreateWithPriority(0, this, &thread_,
base::kThreadPriority_RealtimeAudio);
- CHECK(thread_ != base::kNullThreadHandle);
+ CHECK(!thread_.isNull());
}
void AudioDeviceThread::Thread::Stop(base::MessageLoop* loop_for_join) {
@@ -126,7 +126,7 @@ void AudioDeviceThread::Thread::Stop(base::MessageLoop* loop_for_join) {
std::swap(thread, thread_);
}
- if (thread != base::kNullThreadHandle) {
+ if (!thread.isNull()) {
if (loop_for_join) {
loop_for_join->PostTask(FROM_HERE,
base::Bind(&base::PlatformThread::Join, thread));

Powered by Google App Engine
This is Rietveld 408576698