From bf519f6d706ab19fe5111d19192f0c3170b2a13a Mon Sep 17 00:00:00 2001 From: Leo Chung Date: Tue, 18 Jul 2023 13:46:28 +0800 Subject: [PATCH] unix/mpbthciport: Remove thread detached attribute A detached thread is not joinable, and the behavior maybe undefined. Signed-off-by: Leo Chung --- ports/unix/mpbthciport.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/unix/mpbthciport.c b/ports/unix/mpbthciport.c index 8813ce147c..eb10878e22 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; }