diff options
| author | Leo Chung <gewalalb@gmail.com> | 2023-07-18 13:46:28 +0800 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-07-17 15:01:04 +1000 |
| commit | 220088fff679aa00feaaa1a842bdb1dddc10ff26 (patch) | |
| tree | 19be44ff248c03af1abe7a2b27c9630062aa9bbb | |
| parent | 55e75c4ad4131e72a452e6190473098e8a0521c2 (diff) | |
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>
| -rw-r--r-- | ports/unix/mpbthciport.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/ports/unix/mpbthciport.c b/ports/unix/mpbthciport.c index 95c39f559..765146677 100644 --- a/ports/unix/mpbthciport.c +++ b/ports/unix/mpbthciport.c @@ -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; } |
