Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81080 - trunk/boost/thread
From: vicente.botet_at_[hidden]
Date: 2012-10-28 20:40:00


Author: viboes
Date: 2012-10-28 20:39:59 EDT (Sun, 28 Oct 2012)
New Revision: 81080
URL: http://svn.boost.org/trac/boost/changeset/81080

Log:
Thread: make use of the extracted thread functiors and added default constructor
Text files modified:
   trunk/boost/thread/scoped_thread.hpp | 50 ++++++++-------------------------------
   1 files changed, 11 insertions(+), 39 deletions(-)

Modified: trunk/boost/thread/scoped_thread.hpp
==============================================================================
--- trunk/boost/thread/scoped_thread.hpp (original)
+++ trunk/boost/thread/scoped_thread.hpp 2012-10-28 20:39:59 EDT (Sun, 28 Oct 2012)
@@ -12,6 +12,7 @@
 #include <boost/thread/detail/config.hpp>
 #include <boost/thread/detail/delete.hpp>
 #include <boost/thread/detail/move.hpp>
+#include <boost/thread/thread_functors.hpp>
 #include <boost/thread/thread.hpp>
 
 #include <boost/config/abi_prefix.hpp>
@@ -19,45 +20,6 @@
 namespace boost
 {
 
- struct detach
- {
- void operator()(thread& t)
- {
- t.detach();
- }
- };
-
- struct join_if_joinable
- {
- void operator()(thread& t)
- {
- if (t.joinable())
- {
- t.join();
- }
- }
- };
-
- struct interrupt
- {
- void operator()(thread& t)
- {
- t.interrupt();
- }
- };
-
- struct interrupt_and_join_if_joinable
- {
- void operator()(thread& t)
- {
- t.interrupt();
- if (t.joinable())
- {
- t.join();
- }
- }
- };
-
   /**
    * RAI @c thread wrapper adding a specific destroyer allowing to master what can be done at destruction time.
    *
@@ -134,6 +96,16 @@
     BOOST_THREAD_MOVABLE_ONLY( scoped_thread) /// Movable only
 
     /**
+ * Default Constructor.
+ *
+ * Effects: wraps a not-a-thread.
+ */
+ scoped_thread() BOOST_NOEXCEPT:
+ t_()
+ {
+ }
+
+ /**
      * Constructor from the thread to own.
      *
      * @param t: the thread to own.


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