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

Unified Diff: content/renderer/media/audio_device.cc

Issue 9112029: Safe and reliable fix for 2 race conditions. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 8 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 | « content/renderer/media/audio_device.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_device.cc
===================================================================
--- content/renderer/media/audio_device.cc (revision 116480)
+++ content/renderer/media/audio_device.cc (working copy)
@@ -108,11 +108,6 @@
void AudioDevice::Stop() {
DCHECK(MessageLoop::current() != ChildProcess::current()->io_message_loop());
- // Max waiting time for Stop() to complete. If this time limit is passed,
- // we will stop waiting and return false. It ensures that Stop() can't block
- // the calling thread forever.
- const base::TimeDelta kMaxTimeOut = base::TimeDelta::FromMilliseconds(1000);
-
base::WaitableEvent completion(false, false);
ChildProcess::current()->io_message_loop()->PostTask(
@@ -122,9 +117,7 @@
// We wait here for the IO task to be completed to remove race conflicts
// with OnLowLatencyCreated() and to ensure that Stop() acts as a synchronous
// function call.
- if (!completion.TimedWait(kMaxTimeOut)) {
- LOG(ERROR) << "Failed to shut down audio output on IO thread";
- }
+ completion.Wait();
Chris Rogers 2012/01/06 18:26:28 Is there a case where the time-out is actually nee
tommi (sloooow) - chröme 2012/01/12 13:13:07 What about moving the call to ShutDownAudioThread
ShutDownAudioThread();
}
« no previous file with comments | « content/renderer/media/audio_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698