Added missing pthread_detach() so the thread resources could be reused again.

merge-requests/1/head
Gerhard Jaeger 2004-10-14 06:51:17 +00:00
rodzic 98db315a68
commit 0fb34bb098
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -361,7 +361,7 @@ sanei_thread_waitpid( int pid, int *status )
stat = 0;
DBG(2, "sanei_thread_waitpid() - %d\n", (int)pid);
DBG(2, "sanei_thread_waitpid() - %d\n", pid);
#ifdef USE_PTHREAD
result = pthread_join((pthread_t)pid, (void*)&ls );
@ -375,6 +375,11 @@ sanei_thread_waitpid( int pid, int *status )
DBG(2, "* result = %d (%p)\n", stat, (void*)status );
result = pid;
}
/* call detach in any case to make sure that the thread resources
* will be freed, when the thread has terminated
*/
DBG(2, "* detaching thread(%d)\n", pid );
pthread_detach((pthread_t)pid);
if (status)
*status = stat;