Now calling pthread_detach for each thread
This commit is contained in:
parent
17b8c7b3c0
commit
6ef2a74206
1 changed files with 6 additions and 0 deletions
6
nmux.cpp
6
nmux.cpp
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue