Skip to content
Snippets Groups Projects
Commit a2c333c3 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by David Duarte
Browse files

Don't treat pthread_t as a signed value type

1. HID host treats pthread_t as a signed value. Some platform may define
it as unsigned type.
2. HID host uses -1 as invalid pthread ID. pthread does not define
invalid thread ID.


Bug: 285750089
Test: Floss test "Two BLE connections"
(cherry picked from https://android-review.googlesource.com/q/commit:791d9aa87fa0a1503077a81fa80c51e4c6b620ee)
Merged-In: I77eb1596910ee1a6c9c2244beff7ff382ca57ba0
Change-Id: I77eb1596910ee1a6c9c2244beff7ff382ca57ba0
parent 7692b3bd
No related branches found
No related tags found
No related merge requests found
...@@ -493,11 +493,11 @@ void bta_hh_co_close(btif_hh_device_t* p_dev) { ...@@ -493,11 +493,11 @@ void bta_hh_co_close(btif_hh_device_t* p_dev) {
#endif // ENABLE_UHID_SET_REPORT #endif // ENABLE_UHID_SET_REPORT
/* Stop the polling thread */ /* Stop the polling thread */
p_dev->hh_keep_polling = 0; if (p_dev->hh_keep_polling) {
if (p_dev->hh_poll_thread_id > 0) { p_dev->hh_keep_polling = 0;
pthread_join(p_dev->hh_poll_thread_id, NULL); pthread_join(p_dev->hh_poll_thread_id, NULL);
p_dev->hh_poll_thread_id = -1;
} }
p_dev->hh_poll_thread_id = -1;
/* UHID file descriptor is closed by the polling thread */ /* UHID file descriptor is closed by the polling thread */
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment