| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2004.11.05 12:19 "Re: is libtiff thread-safe?", by John AldridgePhillip 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 |
|||||||