Re: [Boost-bugs] [Boost C++ Libraries] #2100: thread fails to compile with -fno-exceptions

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2100: thread fails to compile with -fno-exceptions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-06-05 15:20:25


#2100: thread fails to compile with -fno-exceptions
----------------------------------+-----------------------------------------
  Reporter: brbarret_at_[hidden] | Owner: anthonyw
      Type: Bugs | Status: new
 Milestone: Boost 1.40.0 | Component: thread
   Version: Boost 1.35.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------+-----------------------------------------
Changes (by Jonathan Wakely <jwakely.boost_at_[hidden]>):

  * milestone: Boost 1.36.0 => Boost 1.40.0

Comment:

 I had a look at your patch, most of it looks fine, but you add
 std::exception as a base class of boost::thread_interrupted. That is a
 very bad idea, boost::thread_interrupted should not derive from any other
 type, so that normal exception-handling code will not interfere with
 interruption handling.

 Consider
 {{{
 while (true)
 {
   try
   {
     lock_guard<mutex> lock(m_mutex);
     processQueue(m_queue);
   }
   catch (std::exception& e)
   {
      std::cerr << "Error processing queue: " << e.what() << '\n';
   }
 }
 }}}
 Currently this loop can be stopped by interrupting the thread, with your
 change it cannot.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2100#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC