Skip to content

Commit 220088f

Browse files
bl4kravendpgeorge
authored andcommitted
unix/mpbthciport: Remove thread detached attribute.
A detached thread is not joinable, and the behavior maybe undefined. Signed-off-by: Leo Chung <[email protected]>
1 parent 55e75c4 commit 220088f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ports/unix/mpbthciport.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,7 @@ int mp_bluetooth_hci_uart_init(uint32_t port, uint32_t baudrate) {
196196
}
197197

198198
// Create a thread to run the polling loop.
199-
pthread_attr_t attr;
200-
pthread_attr_init(&attr);
201-
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
202-
pthread_create(&hci_poll_thread_id, &attr, &hci_poll_thread, NULL);
199+
pthread_create(&hci_poll_thread_id, NULL, &hci_poll_thread, NULL);
203200

204201
return 0;
205202
}

0 commit comments

Comments
 (0)