when using the DiskWriterDriver to export audio and stopping it using AudioEngine::stopAudioDrivers() while the export is still in progress, there is some sort of deadlock. stopAudioDrivers locks the AudioEngine and tells the driver to stop. But in doing so DiskWriterDriver will just wait for the export to complete (which is not right). But in order to export it needs to call the process function of the audio engine and needs to acquire the audio engine lock therein. Now, since this latter will be done using a tryLock and non zero exit code, there is no real deadlock of the AudioEngine. But thread of the DiskWriterDriver is not able to work properly anymore.
Now, stopping the DiskWriterDriver sets a member variable m_bIsRunning which will be checked in the export thread.
when using the
DiskWriterDriver
to export audio and stopping it usingAudioEngine::stopAudioDrivers()
while the export is still in progress, there is some sort of deadlock.stopAudioDrivers
locks theAudioEngine
and tells the driver to stop. But in doing soDiskWriterDriver
will just wait for the export to complete (which is not right). But in order to export it needs to call the process function of the audio engine and needs to acquire the audio engine lock therein. Now, since this latter will be done using a tryLock and non zero exit code, there is no real deadlock of theAudioEngine
. But thread of theDiskWriterDriver
is not able to work properly anymore.Now, stopping the
DiskWriterDriver
sets a member variablem_bIsRunning
which will be checked in the export thread.addressing #1820