AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
November 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.11.04 18:31 "is libtiff thread-safe?", by James Xu
2004.11.04 19:04 "Re: is libtiff thread-safe?", by Bob Friesenhahn
2004.11.04 19:09 "Re: is libtiff thread-safe?", by Chris Losinger
2004.11.04 19:19 "Re: is libtiff thread-safe?", by Bob Friesenhahn
2004.11.04 21:10 "Re: is libtiff thread-safe?", by Joris Van Damme
2004.11.04 21:20 "Re: is libtiff thread-safe?", by Chris Losinger
2004.11.04 21:35 "Re: is libtiff thread-safe?", by Bob Friesenhahn
2004.11.04 23:09 "Re: is libtiff thread-safe?", by Chris Cox
2004.11.04 23:51 "Re: is libtiff thread-safe?", by Joris Van Damme
2004.11.05 00:40 "Re: is libtiff thread-safe?", by Bob Friesenhahn
2004.11.05 00:53 "Re: is libtiff thread-safe?", by Phillip Crews
2004.11.05 12:19 "Re: is libtiff thread-safe?", by John Aldridge
2004.11.05 12:50 "Re: is libtiff thread-safe?", by Joris Van Damme
2004.11.05 01:06 "Re: is libtiff thread-safe?", by Chris Cox
2004.11.05 09:19 "Re: is libtiff thread-safe?", by Joris Van Damme
2004.11.05 14:38 "Re: is libtiff thread-safe?", by Bob Friesenhahn

2004.11.05 12:19 "Re: is libtiff thread-safe?", by John Aldridge

Phillip Crews wrote:
> Bob Friesenhahn wrote:
> > function returns.  If the functions provided a pointer to user context 
> > then the error information could simply be stored there, without any 
> > need to use an OS-specific thread-API function to support 
> > thread-specific storage. 
>
> Another issue is that the pointers to the error and warning handlers are 
> shared by all threads, so different threads cannot set up different 
> error handling routines for different uses.

How about this for solving both problems in one go...

Extend the TIFF data structure to contain a pair of function pointers to 
error and warning handling functions. When an error or warning occurs, 
see whether the relevant pointer is NULL, and if so just call the 
existing global function. If it's not NULL, then call the function from 
the TIFF structure instead, passing the TIFF* as an argument. I guess 
there's no need for specific user context for these functions, as the 
TIFFGet/SetClientInfo seems to cover it?

-- 
John