From 28fb26f79233157c961a1b4e1c8f2286e570c5df Mon Sep 17 00:00:00 2001 From: Adrian Graber Date: Sat, 24 Oct 2020 16:12:10 +0200 Subject: Join CdStream threads to wait for them to exit --- src/core/CdStreamPosix.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/CdStreamPosix.cpp b/src/core/CdStreamPosix.cpp index fdc63a05..5c8d1b16 100644 --- a/src/core/CdStreamPosix.cpp +++ b/src/core/CdStreamPosix.cpp @@ -216,10 +216,12 @@ CdStreamShutdown(void) #ifndef ONE_THREAD_PER_CHANNEL gCdStreamThreadStatus = 2; sem_post(gCdStreamSema); + pthread_join(_gCdStreamThread, nil); #else for ( int32 i = 0; i < gNumChannels; i++ ) { gpReadInfo[i].nThreadStatus = 2; sem_post(gpReadInfo[i].pStartSemaphore); + pthread_join(gpReadInfo[i].pChannelThread, nil); } #endif } -- cgit v1.2.3