FM: wait for previous rx thread to exit
Change-Id: Ied06521865b12989e7f04d9bf8c8785f1cf526e9
diff --git a/fm_hci/fm_hci.cpp b/fm_hci/fm_hci.cpp
index 6c1e07e..4c4d285 100644
--- a/fm_hci/fm_hci.cpp
+++ b/fm_hci/fm_hci.cpp
@@ -624,6 +624,12 @@
ALOGD("++%s", __func__);
+ if(hci.is_rx_thread_running)
+ {
+ ALOGI("%s:previous rx thread running wait until rx thread stops", __func__);
+ hci.rx_thread_.join();
+ ALOGI("%s:stop_rx_thread completed, proceed iniialization", __func__);
+ }
if (!hci_hal || !hci_hal->hal) {
ALOGE("NULL input argument");
return FM_HC_STATUS_NULL_POINTER;