OSDN Git Service

Correct the logic of UIPC thread id check
authorSrinu Jella <sjella@codeaurora.org>
Tue, 12 May 2015 14:48:43 +0000 (20:18 +0530)
committerAndre Eisenbach <eisenbach@google.com>
Tue, 23 Jun 2015 22:45:07 +0000 (15:45 -0700)
commitf88e742ea5f95a529a1758cb00aea0e58fdb9863
tree266567224a9c312e8810b60a652da63c06a556bf
parentbf3e67e76aa2e7eced6b28669f10b599c08ab931
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
udrv/ulinux/uipc.c