Boost logo

Boost :

From: Slawomir Lisznianski (slisznianski_at_[hidden])
Date: 2005-08-19 10:47:44


I find the catch(...) clause in the thread_proxy function (thread.cpp)
causing more harm than good. If exception "leaks" from a function
executing in the context of a thread, the thread silently goes away but
the application continues to operate as if nothing happend. I think, in
this instance, the library simply "does too much" by trying to do the
cleanup. As a user, I can always wrap the code in the catch-all, but
what I cannot change is the fact that when unhandled exception is
thrown, I will not see the function in the stack trace where the
exception originated.
Here is the proposed proxy, after trivial changes:

extern "C" {
    unsigned __stdcall thread_proxy(void* param)
#elif defined(BOOST_HAS_PTHREADS)
        static void* thread_proxy(void* param)
#elif defined(BOOST_HAS_MPTASKS)
        static OSStatus thread_proxy(void* param)
        thread_param* p = static_cast<thread_param*>(param);
        boost::function0<void> threadfunc = p->m_threadfunc;
#if defined(BOOST_HAS_MPTASKS)
        return 0;


Boost list run by bdawes at, gregod at, cpdaniel at, john at