kopia lustrzana https://gitlab.com/sane-project/backends
Added missing pthread_detach() so the thread resources could be reused again.
rodzic
98db315a68
commit
0fb34bb098
|
@ -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;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue