At 06:54 PM 7/19/2004, Nick Kew wrote: >I have a couple of modules using third-party libraries that require me >to supply an "abort" function (or they'll abort by exiting). >For example, libjpeg in my mod_jpeg. > >My preferred approach to this situation is usually to resort to C++, >put my code in a try/catch loop, and provide an abort handler that >throws an exception. However, this doesn't play well with Apache, >and when I run it in gdb, the throw appears to generate an Abort. > >Switching to setjmp/longjmp does appear to work well with apache and gcc. >But that leaves me wondering if I need to worry about thread-safety. >Is using setjmp/longjmp with Worker or Windoze MPM asking for trouble? >And if so, is there an alternative approach I could try?
IIRC - all setjmp and other usually-thread-agnostic calls in a normal clib were redesigned to use TLS in the Win32 msvcrt lib, long before most Unixes considered implementing threads :) I believe on win32 you will be fine, I'd be more worried about the thread implementations. This sure sounds like an abstraction we should assist with using apr. Bill