Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77994 - in trunk: boost/thread/detail libs/thread/doc libs/thread/test libs/thread/test/threads/container libs/thread/test/threads/thread/constr
From: vicente.botet_at_[hidden]
Date: 2012-04-15 08:29:35


Author: viboes
Date: 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
New Revision: 77994
URL: http://svn.boost.org/trac/boost/changeset/77994

Log:
Thread: Set by default to don't use Boost.Move
Text files modified:
   trunk/boost/thread/detail/config.hpp | 10 +++++++++-
   trunk/libs/thread/doc/emulations.qbk | 4 ++--
   trunk/libs/thread/test/Jamfile.v2 | 2 +-
   trunk/libs/thread/test/test_4521.cpp | 4 +++-
   trunk/libs/thread/test/test_thread_move_return.cpp | 3 +++
   trunk/libs/thread/test/test_thread_return_local.cpp | 3 +++
   trunk/libs/thread/test/threads/container/thread_ptr_list_pass.cpp | 2 ++
   trunk/libs/thread/test/threads/container/thread_vector_pass.cpp | 2 ++
   trunk/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp | 2 ++
   9 files changed, 27 insertions(+), 5 deletions(-)

Modified: trunk/boost/thread/detail/config.hpp
==============================================================================
--- trunk/boost/thread/detail/config.hpp (original)
+++ trunk/boost/thread/detail/config.hpp 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
@@ -59,7 +59,9 @@
 
 // Uses Boost.Move by default if not stated the opposite defining BOOST_THREAD_DONT_USE_MOVE
 #if ! defined BOOST_THREAD_DONT_USE_MOVE
-#define BOOST_THREAD_USES_MOVE
+#if ! defined BOOST_THREAD_USES_MOVE
+//#define BOOST_THREAD_USES_MOVE
+#endif
 #endif
 
 #if BOOST_THREAD_VERSION==1
@@ -99,6 +101,12 @@
 #if ! defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V2_0_0
 #define BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V2_0_0
 #endif
+#if ! defined BOOST_THREAD_DONT_USE_MOVE
+#if ! defined BOOST_THREAD_USES_MOVE
+#define BOOST_THREAD_USES_MOVE
+#endif
+#endif
+
 #endif
 
 // BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN is defined if BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS

Modified: trunk/libs/thread/doc/emulations.qbk
==============================================================================
--- trunk/libs/thread/doc/emulations.qbk (original)
+++ trunk/libs/thread/doc/emulations.qbk 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
@@ -41,7 +41,7 @@
     // ...
   };
 
-This could not work on these compilers even if thread is convertible to rv<thread>
+This could not work on some compilers even if thread is convertible to rv<thread> because the compiler prefers the private copy constructor.
 
   thread mkth()
   {
@@ -62,7 +62,7 @@
     return ::boost::move(thread(f));
   }
 
-To make the code portable Boost.Thread uses a macro BOOST_MOVE_RVALUE that can be used as in
+To make the code portable Boost.Thread the user needs to use a macro BOOST_THREAD_MAKE_RV_REF that can be used as in
 
   thread mkth()
   {

Modified: trunk/libs/thread/test/Jamfile.v2
==============================================================================
--- trunk/libs/thread/test/Jamfile.v2 (original)
+++ trunk/libs/thread/test/Jamfile.v2 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
@@ -474,7 +474,7 @@
           [ thread-run2 ./threads/container/thread_ptr_list_pass.cpp : container__thread_ptr_list_p ]
     ;
 
- explicit examples ;
+ #explicit examples ;
     test-suite ts_examples
     :
           [ thread-run ../example/monitor.cpp ]

Modified: trunk/libs/thread/test/test_4521.cpp
==============================================================================
--- trunk/libs/thread/test/test_4521.cpp (original)
+++ trunk/libs/thread/test/test_4521.cpp 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
@@ -7,7 +7,9 @@
 
 int main() {
 boost::packaged_task<int> pt(calculate_the_answer_to_life_the_universe_and_everything);
-boost::unique_future<int> fi=BOOST_THREAD_MAKE_RV_REF(pt.get_future());
+
+//boost::unique_future<int> fi = BOOST_THREAD_MAKE_RV_REF(pt.get_future());
+boost::unique_future<int> fi((BOOST_THREAD_MAKE_RV_REF(pt.get_future())));
 
 boost::thread task(boost::move(pt)); // launch task on a thread
 

Modified: trunk/libs/thread/test/test_thread_move_return.cpp
==============================================================================
--- trunk/libs/thread/test/test_thread_move_return.cpp (original)
+++ trunk/libs/thread/test/test_thread_move_return.cpp 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
@@ -2,6 +2,9 @@
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#define BOOST_THREAD_USES_MOVE
+
 #include <boost/thread/thread.hpp>
 #include <boost/test/unit_test.hpp>
 

Modified: trunk/libs/thread/test/test_thread_return_local.cpp
==============================================================================
--- trunk/libs/thread/test/test_thread_return_local.cpp (original)
+++ trunk/libs/thread/test/test_thread_return_local.cpp 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
@@ -2,6 +2,9 @@
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#define BOOST_THREAD_USES_MOVE
+
 #include <boost/thread/thread.hpp>
 #include <boost/test/unit_test.hpp>
 

Modified: trunk/libs/thread/test/threads/container/thread_ptr_list_pass.cpp
==============================================================================
--- trunk/libs/thread/test/threads/container/thread_ptr_list_pass.cpp (original)
+++ trunk/libs/thread/test/threads/container/thread_ptr_list_pass.cpp 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
@@ -3,6 +3,8 @@
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
+#define BOOST_THREAD_USES_MOVE
+
 #include <boost/config.hpp>
 #include <boost/thread/thread.hpp>
 #include <boost/thread/mutex.hpp>

Modified: trunk/libs/thread/test/threads/container/thread_vector_pass.cpp
==============================================================================
--- trunk/libs/thread/test/threads/container/thread_vector_pass.cpp (original)
+++ trunk/libs/thread/test/threads/container/thread_vector_pass.cpp 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
@@ -3,6 +3,8 @@
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
+#define BOOST_THREAD_USES_MOVE
+
 #include <boost/thread/thread.hpp>
 #include <boost/thread/mutex.hpp>
 #include <boost/container/vector.hpp>

Modified: trunk/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp
==============================================================================
--- trunk/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp (original)
+++ trunk/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp 2012-04-15 08:29:33 EDT (Sun, 15 Apr 2012)
@@ -17,6 +17,8 @@
 
 // template <class F, class ...Args> thread(F&& f, Args&&... args);
 
+#define BOOST_THREAD_USES_MOVE
+
 #include <boost/thread/thread.hpp>
 #include <new>
 #include <cstdlib>


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