mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
fix undefined behavior in ma_thread_wait__posix
Quoting man for pthread_detach: > The behavior is undefined if the value specified by the thread argument > to pthread_detach() does not refer to a joinable thread. Since the thread was joined right before, pthread_detach should not be called.
This commit is contained in:
@@ -15534,7 +15534,6 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority
|
|||||||
static void ma_thread_wait__posix(ma_thread* pThread)
|
static void ma_thread_wait__posix(ma_thread* pThread)
|
||||||
{
|
{
|
||||||
pthread_join((pthread_t)*pThread, NULL);
|
pthread_join((pthread_t)*pThread, NULL);
|
||||||
pthread_detach((pthread_t)*pThread);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user