Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -493,11 +493,11 @@ void bta_hh_co_close(btif_hh_device_t* p_dev) {
#endif  // ENABLE_UHID_SET_REPORT

  /* Stop the polling thread */
  if (p_dev->hh_keep_polling) {
    p_dev->hh_keep_polling = 0;
  if (p_dev->hh_poll_thread_id > 0) {
    pthread_join(p_dev->hh_poll_thread_id, NULL);
  }
    p_dev->hh_poll_thread_id = -1;
  }
  /* UHID file descriptor is closed by the polling thread */
}