kopia lustrzana https://gitlab.com/sane-project/backends
Don't detach unconditionally after pthread_join()
rodzic
20a0ed547e
commit
eb54dbf200
|
@ -512,11 +512,15 @@ sanei_thread_waitpid( SANE_Pid pid, int *status )
|
||||||
DBG(2, "* result = %d (%p)\n", stat, (void*)status );
|
DBG(2, "* result = %d (%p)\n", stat, (void*)status );
|
||||||
result = pid;
|
result = pid;
|
||||||
}
|
}
|
||||||
/* call detach in any case to make sure that the thread resources
|
if ( EDEADLK == rc ) {
|
||||||
* will be freed, when the thread has terminated
|
if ( (pthread_t)pid != pthread_self() ) {
|
||||||
*/
|
/* call detach in any case to make sure that the thread resources
|
||||||
DBG(2, "* detaching thread(%ld)\n", pid );
|
* will be freed, when the thread has terminated
|
||||||
pthread_detach((pthread_t)pid);
|
*/
|
||||||
|
DBG(2, "* detaching thread(%ld)\n", pid );
|
||||||
|
pthread_detach((pthread_t)pid);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (status)
|
if (status)
|
||||||
*status = stat;
|
*status = stat;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue