Boost logo

Boost :

From: Scott McCaskill (scott_at_[hidden])
Date: 2001-08-03 16:36:19


I believe that pthreads-win32 tried something like this (using exceptions to
implement thread cancellation), and as a result they have this in pthread.h:

#pragma message("When compiling applications with MSVC++ and C++ exception
handling:")
#pragma message(" Replace any 'catch( ... )' with 'PtW32CatchAll' in POSIX
threads")
#pragma message(" if you want POSIX thread cancelation and pthread_exit to
work.")

#define PtW32CatchAll \
        catch( ptw32_exception & ) { throw; } \
        catch( ... )

This means that if you want cancellation to work reliably, your thread can't
execute any code that you don't have the source for unless you can somehow
be sure that it never uses catch(...). For a general purpose library, this
is at best very kludgy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk