summaryrefslogtreecommitdiffstats
path: root/fm_hci/fm_hci.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fm_hci/fm_hci.cpp')
-rw-r--r--fm_hci/fm_hci.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/fm_hci/fm_hci.cpp b/fm_hci/fm_hci.cpp
index 76949d2..6a9dba6 100644
--- a/fm_hci/fm_hci.cpp
+++ b/fm_hci/fm_hci.cpp
@@ -661,7 +661,14 @@ int fm_hci_init(fm_hci_hal_t *hci_hal)
__func__, hci.state);
if(hci.state == FM_RADIO_ENABLING){
Lock lk(hci.on_mtx);
- hci.on_cond.wait(lk);
+ std::cv_status status = std::cv_status::no_timeout;
+ auto now = std::chrono::system_clock::now();
+ status =
+ hci.on_cond.wait_until(lk, now + std::chrono::seconds(HCI_TIMEOUT));
+ if (status == std::cv_status::timeout) {
+ ALOGE("hci_initialize failed, kill the fm process");
+ kill(getpid(), SIGKILL);
+ }
}
}