-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix temporary deadlock in A2DP codec selection
If a D-Bus client thread locks the codec_id_mtx mutex while BlueZ is processing a SetConfiguration request, then that can lead to the main thread being blocked if a client calls any method that needs to read the current codec. However, the SetConfiguration request needs the main thread to be active to respond to the ClearConfiguration call that BlueZ makes during its own handling of SetConfiguration. So, there is a risk of deadlock if the client attempts to read the codec ID while SetConfiguration is in progress. This deadlock is temporary because the D-Bus calls have a timeout - but BlueZ handles the timeout by closing the A2DP profile connection. There does not appear to be any clear reason why SetConfiguration needs to lock the client_id_mtx mutex, since it does not actually modify the transport codec_id (a new transport instance is created instead). So this commit avoids this deadlock simply by removing the codec_id_mtx mutex lock from ba_transport_select_codec_a2dp(). Fixes #725
- Loading branch information
Showing
3 changed files
with
33 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters