DescriptionStop the AudioDeviceThread when the IO loop goes away.
When shutting down, the pipeline code can take a long time to terminate.
In some rare cases, the IO loop terminates before the pipeline thread and
the audio device classes would attempt to use the io loop to perform tasks on.
I checked in a candidate fix for this a couple of weeks ago which monitors the
lifetime of the IO loop and uses MessageLoopProxy* instead of MessageLoop* to
avoid issues with using the NULL loop. That fixes part of the problem.
What was missing was also stopping the audio thread in this case since the IO
thread will run teardown before the Pipeline thread calls AudioDevice::Stop().
In that period, the audio thread will still be running but the callback object
has been deleted.
Additionally, I'm adding a lock to guard the thread_ variable in AudioDeviceThread.
Before I was relying on external synchronization in the AudioDevice and
AudioInputDevice state machine. However, it doesn't hurt to go belt and
suspenders although it might not look cool ;)
BUG=115299
TEST=Follow repro steps in bug report.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=124330
Patch Set 1 #Patch Set 2 : Handle another edge case #
Total comments: 8
Patch Set 3 : Remove mutable. Stop thread synchronously if needed in ShutdownOnIOThread with IO exception. #
Messages
Total messages: 8 (0 generated)
|