Boost logo

Boost :

From: Kim Barrett (kab_at_[hidden])
Date: 2006-06-16 18:57:58


Back in August 2005 there was a discussion on this list of the pros
and cons of the existance of the try/catch(...) in thread_proxy(),
which seemed to me to end with a pretty clear consensus that it
should be removed. There was also a bug report filed around that time
about this: 1274707.

Having spent about a couple of days in the past week helping
coworkers track down problems that ultimately proved to be obvious
mistakes that were hidden by that catch clause, I've patched our
local copy of boost 1.33.1 to remove that "feature". (I'd rather not
think about how much time the affected coworkers lost to this.) I
also checked boost CVS and found that this change hasn't been made
there yet, so I'm attaching the patch below.

-----------------------------------

--- thread.cpp.orig 2005-07-14 11:46:50.000000000 -0400
+++ thread.cpp 2006-06-16 18:17:33.000000000 -0400
@@ -105,22 +105,13 @@
          static OSStatus thread_proxy(void* param)
  #endif
      {
- try
- {
- thread_param* p = static_cast<thread_param*>(param);
- boost::function0<void> threadfunc = p->m_threadfunc;
- p->started();
- threadfunc();
+ thread_param* p = static_cast<thread_param*>(param);
+ boost::function0<void> threadfunc = p->m_threadfunc;
+ p->started();
+ threadfunc();
  #if defined(BOOST_HAS_WINTHREADS)
- on_thread_exit();
+ on_thread_exit();
  #endif
- }
- catch (...)
- {
-#if defined(BOOST_HAS_WINTHREADS)
- on_thread_exit();
-#endif
- }
  #if defined(BOOST_HAS_MPTASKS)
          ::boost::detail::thread_cleanup();
  #endif


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