unix/mpbthciport: Remove thread detached attribute

A detached thread is not joinable, and the behavior maybe undefined.

Signed-off-by: Leo Chung <gewalalb@gmail.com>
pull/12036/head
Leo Chung 2023-07-18 13:46:28 +08:00
rodzic 7d66ae603d
commit bf519f6d70
1 zmienionych plików z 1 dodań i 4 usunięć

Wyświetl plik

@ -196,10 +196,7 @@ int mp_bluetooth_hci_uart_init(uint32_t port, uint32_t baudrate) {
}
// Create a thread to run the polling loop.
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_create(&hci_poll_thread_id, &attr, &hci_poll_thread, NULL);
pthread_create(&hci_poll_thread_id, NULL, &hci_poll_thread, NULL);
return 0;
}