summaryrefslogtreecommitdiffstats
path: root/udrv
diff options
context:
space:
mode:
authorSrinu Jella <sjella@codeaurora.org>2015-05-12 20:18:43 +0530
committerAndre Eisenbach <eisenbach@google.com>2015-06-23 15:45:07 -0700
commitf88e742ea5f95a529a1758cb00aea0e58fdb9863 (patch)
tree266567224a9c312e8810b60a652da63c06a556bf /udrv
parentbf3e67e76aa2e7eced6b28669f10b599c08ab931 (diff)
downloadandroid_system_bt-f88e742ea5f95a529a1758cb00aea0e58fdb9863.tar.gz
android_system_bt-f88e742ea5f95a529a1758cb00aea0e58fdb9863.tar.bz2
android_system_bt-f88e742ea5f95a529a1758cb00aea0e58fdb9863.zip
Correct the logic of UIPC thread id check
Use case: Check the A2dp play , pause from headset STR: Connect to the headset from DUT Try play , pause from Headset once the song is started playing from headset. Failure: Bluetooth process crashed due to invalid fd descriptor while clearing fds using FD_CLR Root cause: Root cause for this issue is pthread join mechanism for UIPC thread is not proper ( incorrect logic ), as a result UIPC thread still running, and A2DP media task will try to start a new UIPC thread before the previous UIPC read thread is closed, finally sometimes this scenario leads to this issue. This issue doesn't come always, if the media task is in process of initiating the fds before staring the new UIPC thread, and previous UIPC thread is in exiting state. Fix: Correct the logic of UIPC thread id check while joining the UIPC thread. Thread id might hold pointer value where it's value is negative vaule with singed bit is set,so corrected the logic to check against zero or non zero. Bug: 21896912 Change-Id: I1307d848958656e718e95a972f258526470b1974
Diffstat (limited to 'udrv')
-rw-r--r--udrv/ulinux/uipc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/udrv/ulinux/uipc.c b/udrv/ulinux/uipc.c
index c3f8527d6..f3c746e09 100644
--- a/udrv/ulinux/uipc.c
+++ b/udrv/ulinux/uipc.c
@@ -569,7 +569,10 @@ void uipc_stop_main_server_thread(void)
UIPC_UNLOCK();
/* wait until read thread is fully terminated */
- if (uipc_main.tid > 0)
+ /* tid might hold pointer value where it's value
+ is negative vaule with singed bit is set, so
+ corrected the logic to check zero or non zero */
+ if (uipc_main.tid)
pthread_join(uipc_main.tid, NULL);
}