commit | d21521245ae92847600613bee7a225f23bc44f20 | [log] [tgz] |
---|---|---|
author | Vlad Popa <pvlad@google.com> | Wed Aug 02 18:36:04 2023 -0700 |
committer | Vlad Popa <pvlad@google.com> | Thu Aug 03 18:03:02 2023 -0700 |
tree | 4f4be885b6f2c979847bccef24637ab3a4b83350 | |
parent | aaec79762def63068c84424b10f7d73b5f3554a3 [diff] [blame] |
APC: Add possible deadlock fix when creating track When creating a new track the thread lock is being held. This can have the effect of causing a deadlock when the OpPlayAudioMonitor is being created since the onFirstRef method could also try to access the same thread lock. Removing the broadcast when calling onFirstRef which is not needed and would also avoid the deadlock Test: atest AudioPlaybackConfigurationTest Bug: 289885996 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d585959ccce748ba024c63d09b08d737eabfc70a) Merged-In: I16555608176f1b1dfa180e82346319b55c19de01 Change-Id: I16555608176f1b1dfa180e82346319b55c19de01
diff --git a/services/audioflinger/PlaybackTracks.h b/services/audioflinger/PlaybackTracks.h index 2602efb..181829f 100644 --- a/services/audioflinger/PlaybackTracks.h +++ b/services/audioflinger/PlaybackTracks.h
@@ -55,7 +55,7 @@ sp<PlayAudioOpCallback> mOpCallback; // called by PlayAudioOpCallback when OP_PLAY_AUDIO is updated in AppOp callback - void checkPlayAudioForUsage(); + void checkPlayAudioForUsage(bool doBroadcast); wp<AudioFlinger::ThreadBase> mThread; std::atomic_bool mHasOpPlayAudio;