Loading services/audioflinger/AudioFlinger.cpp +18 −5 Original line number Diff line number Diff line Loading @@ -635,8 +635,12 @@ sp<IAudioTrack> AudioFlinger::createTrack( if (lStatus != NO_ERROR) { // remove local strong reference to Client before deleting the Track so that the // Client destructor is called by the TrackBase destructor with mClientLock held // Don't hold mClientLock when releasing the reference on the track as the // destructor will acquire it. { Mutex::Autolock _cl(mClientLock); client.clear(); } track.clear(); goto Exit; } Loading Loading @@ -1173,7 +1177,7 @@ void AudioFlinger::registerClient(const sp<IAudioFlingerClient>& client) } // mClientLock should not be held here because ThreadBase::sendIoConfigEvent() will lock the // ThreadBase mutex and teh locknig order is ThreadBase::mLock then AudioFlinger::mClientLock. // ThreadBase mutex and the locking order is ThreadBase::mLock then AudioFlinger::mClientLock. if (clientAdded) { // the config change is always sent from playback or record threads to avoid deadlock // with AudioSystem::gLock Loading Loading @@ -1419,8 +1423,12 @@ sp<IAudioRecord> AudioFlinger::openRecord( if (lStatus != NO_ERROR) { // remove local strong reference to Client before deleting the RecordTrack so that the // Client destructor is called by the TrackBase destructor with mClientLock held // Don't hold mClientLock when releasing the reference on the track as the // destructor will acquire it. { Mutex::Autolock _cl(mClientLock); client.clear(); } recordTrack.clear(); goto Exit; } Loading Loading @@ -2380,6 +2388,11 @@ sp<IEffect> AudioFlinger::createEffect( if (handle != 0 && id != NULL) { *id = handle->id(); } if (handle == 0) { // remove local strong reference to Client with mClientLock held Mutex::Autolock _cl(mClientLock); client.clear(); } } Exit: Loading Loading
services/audioflinger/AudioFlinger.cpp +18 −5 Original line number Diff line number Diff line Loading @@ -635,8 +635,12 @@ sp<IAudioTrack> AudioFlinger::createTrack( if (lStatus != NO_ERROR) { // remove local strong reference to Client before deleting the Track so that the // Client destructor is called by the TrackBase destructor with mClientLock held // Don't hold mClientLock when releasing the reference on the track as the // destructor will acquire it. { Mutex::Autolock _cl(mClientLock); client.clear(); } track.clear(); goto Exit; } Loading Loading @@ -1173,7 +1177,7 @@ void AudioFlinger::registerClient(const sp<IAudioFlingerClient>& client) } // mClientLock should not be held here because ThreadBase::sendIoConfigEvent() will lock the // ThreadBase mutex and teh locknig order is ThreadBase::mLock then AudioFlinger::mClientLock. // ThreadBase mutex and the locking order is ThreadBase::mLock then AudioFlinger::mClientLock. if (clientAdded) { // the config change is always sent from playback or record threads to avoid deadlock // with AudioSystem::gLock Loading Loading @@ -1419,8 +1423,12 @@ sp<IAudioRecord> AudioFlinger::openRecord( if (lStatus != NO_ERROR) { // remove local strong reference to Client before deleting the RecordTrack so that the // Client destructor is called by the TrackBase destructor with mClientLock held // Don't hold mClientLock when releasing the reference on the track as the // destructor will acquire it. { Mutex::Autolock _cl(mClientLock); client.clear(); } recordTrack.clear(); goto Exit; } Loading Loading @@ -2380,6 +2388,11 @@ sp<IEffect> AudioFlinger::createEffect( if (handle != 0 && id != NULL) { *id = handle->id(); } if (handle == 0) { // remove local strong reference to Client with mClientLock held Mutex::Autolock _cl(mClientLock); client.clear(); } } Exit: Loading