Boost logo

Boost-Commit :

From: anthony_at_[hidden]
Date: 2007-11-14 07:17:42


Author: anthonyw
Date: 2007-11-14 07:17:41 EST (Wed, 14 Nov 2007)
New Revision: 41087
URL: http://svn.boost.org/trac/boost/changeset/41087

Log:
interrupt and join all threads in a group if an exception is thrown during a test
Text files modified:
   trunk/libs/thread/src/pthread/thread.cpp | 13 +++++++++++++
   1 files changed, 13 insertions(+), 0 deletions(-)

Modified: trunk/libs/thread/src/pthread/thread.cpp
==============================================================================
--- trunk/libs/thread/src/pthread/thread.cpp (original)
+++ trunk/libs/thread/src/pthread/thread.cpp 2007-11-14 07:17:41 EST (Wed, 14 Nov 2007)
@@ -491,6 +491,19 @@
         }
     }
 
+ void thread_group::interrupt_all()
+ {
+ boost::lock_guard<mutex> guard(m);
+
+ for(std::list<thread*>::iterator it=threads.begin(),end=threads.end();
+ it!=end;
+ ++it)
+ {
+ (*it)->interrupt();
+ }
+ }
+
+
     int thread_group::size() const
     {
         return m_threads.size();


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk