Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2239b7a7 authored by Bailey Forrest's avatar Bailey Forrest Committed by Myles Watson
Browse files

a2dp_source: Use SIZE_MAX queue size for worker_thread

If the queue runs out of space, we can run into a deadlock.
Explanation of the deadlock is in the bug.

If I connect and disconnect ~20 times in quick succession I would
usually run into this issue

Bug: 72121764
Test: Connect/disconnect 170 times with script, issue does not occur.
Change-Id: I0a76e51aa99481f9fe4885b879209b3d215ae5b0
parent f59aa227
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ bool btif_a2dp_source_startup(void) {

  /* Start A2DP Source media task */
  btif_a2dp_source_cb.worker_thread =
      thread_new("btif_a2dp_source_worker_thread");
      thread_new_sized("btif_a2dp_source_worker_thread", SIZE_MAX);
  if (btif_a2dp_source_cb.worker_thread == NULL) {
    APPL_TRACE_ERROR("%s: unable to start up media thread", __func__);
    btif_a2dp_source_state = BTIF_A2DP_SOURCE_STATE_OFF;