[sane-devel] Problem with Plustek and Canonscan 1220u on Mac 10.3.2

Gerhard Jaeger gerhard@gjaeger.de
Tue, 24 Feb 2004 09:01:40 +0100


Hi,


On Monday 23 February 2004 23:30, Mattias Ellert wrote:
[SNIPSNAP]
> > [sanei_thread] func() done - status = 0
>
> The cancelling of the reader thread fails.
>
> Since pthread_cancel is broken on MacOS X there is a workaround
> implemented in sanei_thread. This workaround essentially replaces the
> sanei_cancel call with a SIGUSR2 signal. This means that backends SHOULD
> NEVER disable the SIGUSR2 signal on MacOS X if they want to be cancelled.
>
> For the Plustek backend the following code:
>
> 	sigfillset ( &ignore_set );
> 	sigdelset  ( &ignore_set, SIGTERM );
> 	sigprocmask( SIG_SETMASK, &ignore_set, 0 );
>
> should be changed to:
>
> 	sigfillset ( &ignore_set );
> 	sigdelset  ( &ignore_set, SIGTERM );
> #if defined (__APPLE__) && defined (__MACH__)
> 	sigdelset  ( &ignore_set, SIGUSR2 );
> #endif
> 	sigprocmask( SIG_SETMASK, &ignore_set, 0 );
>
> This probably affects other backends as well.

You are right, so the proposed code should also go to sanei_thread and no 
backends need to be changed...
Mattias, can you test this on MacOSX - simply apply it to sanei_thread_begin()
Probably you should check which mask is already set...

Ciao,
  Gerhard