Skip to content

Commit 6ef2a74

Browse files
committed
Now calling pthread_detach for each thread
1 parent 17b8c7b commit 6ef2a74

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nmux.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@ int main(int argc, char* argv[])
201201
{
202202
if(clients[i]->status == CS_THREAD_FINISHED)
203203
{
204+
if(pthread_detach(clients[i]->thread)!=0)
205+
{
206+
fprintf(stderr,"nmux pthread_detach failed for client %d\n", i);
207+
continue;
208+
}
209+
204210
if(NMUX_DEBUG) fprintf(stderr, "mainfor: client removed: %d\n", i);
205211
//client destructor
206212
pool->remove_thread(clients[i]->tsmthread);

0 commit comments

Comments
 (0)