Now calling pthread_detach for each thread

This commit is contained in:
Andras Retzler 2019-02-27 17:07:58 +01:00
parent 17b8c7b3c0
commit 6ef2a74206

View file

@ -201,6 +201,12 @@ int main(int argc, char* argv[])
{ {
if(clients[i]->status == CS_THREAD_FINISHED) if(clients[i]->status == CS_THREAD_FINISHED)
{ {
if(pthread_detach(clients[i]->thread)!=0)
{
fprintf(stderr,"nmux pthread_detach failed for client %d\n", i);
continue;
}
if(NMUX_DEBUG) fprintf(stderr, "mainfor: client removed: %d\n", i); if(NMUX_DEBUG) fprintf(stderr, "mainfor: client removed: %d\n", i);
//client destructor //client destructor
pool->remove_thread(clients[i]->tsmthread); pool->remove_thread(clients[i]->tsmthread);