kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'remove-asynch-cancel' into 'master'
sanei_thread.c: Use deferred cancellation mode See merge request sane-project/backends!881merge-requests/881/merge
commit
8f5708b4ef
|
@ -333,6 +333,10 @@ local_thread( void *arg )
|
||||||
static int status;
|
static int status;
|
||||||
pThreadDataDef ltd = (pThreadDataDef)arg;
|
pThreadDataDef ltd = (pThreadDataDef)arg;
|
||||||
|
|
||||||
|
/* Set signal handlers for Mac and Mach. On other systems,
|
||||||
|
* thread cancellation is enabled in deferred mode,
|
||||||
|
* which is glibc default.
|
||||||
|
*/
|
||||||
#if defined (__APPLE__) && defined (__MACH__)
|
#if defined (__APPLE__) && defined (__MACH__)
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
|
|
||||||
|
@ -340,11 +344,6 @@ local_thread( void *arg )
|
||||||
act.sa_flags = 0;
|
act.sa_flags = 0;
|
||||||
act.sa_handler = thread_exit_handler;
|
act.sa_handler = thread_exit_handler;
|
||||||
sigaction( SIGUSR2, &act, 0 );
|
sigaction( SIGUSR2, &act, 0 );
|
||||||
#else
|
|
||||||
int old;
|
|
||||||
|
|
||||||
pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, &old );
|
|
||||||
pthread_setcanceltype ( PTHREAD_CANCEL_ASYNCHRONOUS, &old );
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DBG( 2, "thread started, calling func() now...\n" );
|
DBG( 2, "thread started, calling func() now...\n" );
|
||||||
|
|
Ładowanie…
Reference in New Issue