[sane-devel] Compiling sane-backends CVS 2003/10/22 on OS/2

Gerhard Jaeger gerhard at gjaeger.de
Wed Oct 29 16:15:52 GMT 2003


Hi,

On Wednesday 29 October 2003 11:51, Henning Meier-Geinitz wrote:
[SNIPSNAP]
> The mustek backend has now support for sanei_thread. 

good work ;-)

> At least on Linux, it does not work perfectly (cancelling leads to segfaults
> sometimes).

As I stated in my former mails, when using pthreads and the canceling
mechanism, one should in general try and let the thread die gracefully.
Which leads to some command exchange mechanism i.e.
The "cancel"-command sets a variable, that will be checked by the 
reader thread. If detected active, the reader thread stops its acitivity
and exists. Doing this the hard-way via pthread_cancel it might be, that
you run into trouble.
One thing you can test is:
comment out the line with pthread_setcanceltype (should be 201), recompile
and check if the segfault behaviour is better...

Ciao,
  Gerhard





More information about the sane-devel mailing list