FM: Modified condition variable wait to avoid deadlock
Added an additional condition to block the thread until
event queue is not empty
Change-Id: I8e68eb4db01cf551e03f2860255bee8b5a385a63
diff --git a/fm_hci/fm_hci.cpp b/fm_hci/fm_hci.cpp
index 527ecb4..04dea0c 100644
--- a/fm_hci/fm_hci.cpp
+++ b/fm_hci/fm_hci.cpp
@@ -430,7 +430,7 @@
while (hci.state != FM_RADIO_DISABLING && hci.state != FM_RADIO_DISABLED) {
//wait for rx event
ALOGI("%s:before wait", __func__);
- hci.rx_cond.wait(lk);
+ hci.rx_cond.wait(lk, []{return !hci.rx_event_queue.empty();});
ALOGI("%s:after wait ", __func__);
dequeue_fm_rx_event();
}