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

Unified Diff: chrome/browser/chromeos/audio_mixer_alsa.cc

Issue 6254016: SetIOAllowed when stopping worker audio threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos
Patch Set: formatting Created 9 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/audio_mixer_pulse.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/audio_mixer_alsa.cc
diff --git a/chrome/browser/chromeos/audio_mixer_alsa.cc b/chrome/browser/chromeos/audio_mixer_alsa.cc
index 01c22bdae36451a27c4bd454591b0db0a8af680d..a42868e339dc89ff877dfc6a3bd42ecbc60b4152 100644
--- a/chrome/browser/chromeos/audio_mixer_alsa.cc
+++ b/chrome/browser/chromeos/audio_mixer_alsa.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/task.h"
+#include "base/threading/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -51,6 +52,11 @@ AudioMixerAlsa::AudioMixerAlsa()
AudioMixerAlsa::~AudioMixerAlsa() {
FreeAlsaMixer();
if (thread_ != NULL) {
+ // A ScopedAllowIO object is required to join the thread when calling Stop.
+ // The worker thread should be idle at this time.
+ // See http://crosbug.com/11110 for discussion.
+ base::ThreadRestrictions::ScopedAllowIO allow_io_for_thread_join;
+
thread_->Stop();
thread_.reset();
}
@@ -301,7 +307,7 @@ void AudioMixerAlsa::DoSetVolumeMute(double pref_volume, int pref_mute) {
save_volume_ = pref_volume;
DoSetVolumeDb_Locked(min_volume_);
} else {
- DoSetVolumeDb_Locked(pref_volume);
+ DoSetVolumeDb_Locked(pref_volume);
}
SetElementMuted_Locked(elem_master_, mute);
« no previous file with comments | « no previous file | chrome/browser/chromeos/audio_mixer_pulse.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698