OSDN Git Service

Fix a crash for a race condition during Bluetooth shutdown
authorPavlin Radoslavov <pavlin@google.com>
Tue, 4 Aug 2015 04:58:45 +0000 (21:58 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Tue, 4 Aug 2015 05:09:08 +0000 (22:09 -0700)
commitcaaa00f5ede96461e11de866ac15f5224442d1eb
tree598fe0c44d7fe7c15af18783233e92f953718e7d
parent9de273d9fb99b9f612b8acd50e09225f60444363
Fix a crash for a race condition during Bluetooth shutdown

This is same race condition observed in btif_media_task_aa_tx_flush_req()
because btif_media_task_aa_tx_flush_req() and btif_media_task_stop_aa_req()
are called back-to-bach.

This race condition is triggered when A2DP audio is streaming on shutdown:
"btif_a2dp_on_stopped() -> btif_media_task_stop_aa_req()" is called
to stop the particular audio stream, and this happens right after
the "cleanup() -> btif_a2dp_stop_media_task()" processing during
the shutdown of the Bluetooth stack.

Bug: 22700411
Change-Id: Ia0c98d44a108cf0f57731ac8129e4d76c9934542
btif/src/btif_media_task.c