diff options
author | Kamal Negi <kamaln@codeaurora.org> | 2016-11-18 11:55:20 +0530 |
---|---|---|
committer | Kamal Negi <kamaln@codeaurora.org> | 2016-11-22 14:37:53 +0530 |
commit | ca34f87ed8d3d5448c2b1a88c705f6c40c87779e (patch) | |
tree | 49cfde4a1ab12ac7d8db7f6ac4ede0ab714c8c75 | |
parent | 7e4074908c5682bf7ccfeb8cf5fbab2e7d29034b (diff) | |
download | android_hardware_qcom_fm-ca34f87ed8d3d5448c2b1a88c705f6c40c87779e.tar.gz android_hardware_qcom_fm-ca34f87ed8d3d5448c2b1a88c705f6c40c87779e.tar.bz2 android_hardware_qcom_fm-ca34f87ed8d3d5448c2b1a88c705f6c40c87779e.zip |
Check for TX event before waiting for an event
Check for an event before waiting for an event. If event already signalled
and we wait for an event without checking, it can lead to an infinite wait
for signal. This results in functional failure.
CRs-Fixed: 1091781
Change-Id: I7bb1ef12f4622f9d94621a9c486a771226aba9f4
-rw-r--r-- | fm_hci/fm_hci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fm_hci/fm_hci.c b/fm_hci/fm_hci.c index a3666af..c48edd5 100644 --- a/fm_hci/fm_hci.c +++ b/fm_hci/fm_hci.c @@ -338,7 +338,8 @@ static void* hci_tx_thread(void *arg) while (lib_running) { pthread_mutex_lock(&hci->event_lock); - pthread_cond_wait(&hci->event_cond, &hci->event_lock); + if (!(ready_events & HC_EVENT_TX)) + pthread_cond_wait(&hci->event_cond, &hci->event_lock); ALOGE("%s: ready_events= %d", __func__, ready_events); events = ready_events; if (ready_events & HC_EVENT_TX) |