Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78139 - in trunk/boost/thread: . detail pthread win32
From: vicente.botet_at_[hidden]
Date: 2012-04-22 12:33:50


Author: viboes
Date: 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
New Revision: 78139
URL: http://svn.boost.org/trac/boost/changeset/78139

Log:
Thread: more move semantics refactoring cleanup
Text files modified:
   trunk/boost/thread/detail/delete.hpp | 3 -
   trunk/boost/thread/detail/memory.hpp | 10 +----
   trunk/boost/thread/detail/move.hpp | 1
   trunk/boost/thread/detail/scoped_enum.hpp | 3 -
   trunk/boost/thread/exceptions.hpp | 1
   trunk/boost/thread/future.hpp | 80 +++-------------------------------------
   trunk/boost/thread/locks.hpp | 9 ++--
   trunk/boost/thread/pthread/mutex.hpp | 2
   trunk/boost/thread/pthread/once.hpp | 1
   trunk/boost/thread/pthread/recursive_mutex.hpp | 1
   trunk/boost/thread/pthread/thread_data.hpp | 1
   trunk/boost/thread/shared_mutex.hpp | 1
   trunk/boost/thread/win32/basic_recursive_mutex.hpp | 1
   trunk/boost/thread/win32/basic_timed_mutex.hpp | 1
   trunk/boost/thread/win32/condition_variable.hpp | 2
   trunk/boost/thread/win32/mutex.hpp | 1
   trunk/boost/thread/win32/once.hpp | 1
   trunk/boost/thread/win32/shared_mutex.hpp | 1
   trunk/boost/thread/win32/thread_data.hpp | 1
   19 files changed, 28 insertions(+), 93 deletions(-)

Modified: trunk/boost/thread/detail/delete.hpp
==============================================================================
--- trunk/boost/thread/detail/delete.hpp (original)
+++ trunk/boost/thread/detail/delete.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -1,5 +1,4 @@
-// Copyright (C) 2012
-// Vicente J. Botet Escriba
+// Copyright (C) 2012 Vicente J. Botet Escriba
 //
 // 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)

Modified: trunk/boost/thread/detail/memory.hpp
==============================================================================
--- trunk/boost/thread/detail/memory.hpp (original)
+++ trunk/boost/thread/detail/memory.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -1,16 +1,10 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Pablo Halpern 2009. Distributed under the Boost
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 // Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2011-2012. 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)
-//
-// See http://www.boost.org/libs/container for documentation.
+// See http://www.boost.org/libs/thread for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
 

Modified: trunk/boost/thread/detail/move.hpp
==============================================================================
--- trunk/boost/thread/detail/move.hpp (original)
+++ trunk/boost/thread/detail/move.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -2,6 +2,7 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 
 #ifndef BOOST_THREAD_MOVE_HPP
 #define BOOST_THREAD_MOVE_HPP

Modified: trunk/boost/thread/detail/scoped_enum.hpp
==============================================================================
--- trunk/boost/thread/detail/scoped_enum.hpp (original)
+++ trunk/boost/thread/detail/scoped_enum.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -1,5 +1,4 @@
-// Copyright (C) 2012
-// Vicente J. Botet Escriba
+// Copyright (C) 2012 Vicente J. Botet Escriba
 //
 // 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)

Modified: trunk/boost/thread/exceptions.hpp
==============================================================================
--- trunk/boost/thread/exceptions.hpp (original)
+++ trunk/boost/thread/exceptions.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -1,6 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 // Copyright (C) 2007-9 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // 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)

Modified: trunk/boost/thread/future.hpp
==============================================================================
--- trunk/boost/thread/future.hpp (original)
+++ trunk/boost/thread/future.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -1,4 +1,5 @@
 // (C) Copyright 2008-10 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -368,8 +369,7 @@
             struct dummy;
             typedef typename boost::mpl::if_<boost::is_fundamental<T>,dummy&,BOOST_THREAD_RV_REF(T)>::type rvalue_source_type;
             typedef typename boost::mpl::if_<boost::is_fundamental<T>,T,BOOST_THREAD_RV_REF(T)>::type move_dest_type;
-#else
-#if defined BOOST_THREAD_USES_MOVE
+#elif defined BOOST_THREAD_USES_MOVE
             typedef T& source_reference_type;
             typedef typename boost::mpl::if_<boost::has_move_emulation_enabled<T>,BOOST_THREAD_RV_REF(T),T const&>::type rvalue_source_type;
             typedef typename boost::mpl::if_<boost::has_move_emulation_enabled<T>,BOOST_THREAD_RV_REF(T),T>::type move_dest_type;
@@ -378,7 +378,7 @@
             typedef typename boost::mpl::if_<boost::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T const&>::type rvalue_source_type;
             typedef typename boost::mpl::if_<boost::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T>::type move_dest_type;
 #endif
-#endif
+
             typedef const T& shared_future_get_result_type;
 
             static void init(storage_type& storage,source_reference_type t)
@@ -820,18 +820,12 @@
         ~BOOST_THREAD_FUTURE()
         {}
 
-//#ifndef BOOST_NO_RVALUE_REFERENCES
-// BOOST_THREAD_FUTURE(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE) other) BOOST_NOEXCEPT
-// {
-// future_.swap(BOOST_THREAD_RV(other).future_);
-// }
-//#else
         BOOST_THREAD_FUTURE(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE) other) BOOST_NOEXCEPT:
             future_(BOOST_THREAD_RV(other).future_)
         {
             BOOST_THREAD_RV(other).future_.reset();
         }
-//#endif
+
         BOOST_THREAD_FUTURE& operator=(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE) other) BOOST_NOEXCEPT
         {
             future_=BOOST_THREAD_RV(other).future_;
@@ -972,16 +966,6 @@
             future_=other.future_;
             return *this;
         }
-//#ifndef BOOST_NO_RVALUE_REFERENCES
-// shared_future(BOOST_THREAD_RV_REF(shared_future) other) BOOST_NOEXCEPT
-// {
-// future_.swap(BOOST_THREAD_RV(other).future_);
-// }
-// shared_future(BOOST_THREAD_RV_REF_BEG BOOST_THREAD_FUTURE<R> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
-// {
-// future_.swap(BOOST_THREAD_RV(other).future_);
-// }
-//#else
         shared_future(BOOST_THREAD_RV_REF(shared_future) other) BOOST_NOEXCEPT :
             future_(BOOST_THREAD_RV(other).future_)
         {
@@ -992,7 +976,6 @@
         {
             BOOST_THREAD_RV(other).future_.reset();
         }
-//#endif
         shared_future& operator=(BOOST_THREAD_RV_REF(shared_future) other) BOOST_NOEXCEPT
         {
             future_.swap(BOOST_THREAD_RV(other).future_);
@@ -1155,28 +1138,6 @@
         }
 
         // Assignment
-//#ifndef BOOST_NO_RVALUE_REFERENCES
-// promise(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT:
-// future_obtained(BOOST_THREAD_RV(rhs).future_obtained)
-// {
-// future_.swap(BOOST_THREAD_RV(rhs).future_);
-// BOOST_THREAD_RV(rhs).future_.reset();
-// BOOST_THREAD_RV(rhs).future_obtained=false;
-// }
-// promise & operator=(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT
-// {
-//#if defined BOOST_THREAD_PROMISE_LAZY
-// future_.swap(BOOST_THREAD_RV(rhs).future_);
-// future_obtained=BOOST_THREAD_RV(rhs).future_obtained;
-// BOOST_THREAD_RV(rhs).future_.reset();
-// BOOST_THREAD_RV(rhs).future_obtained=false;
-//#else
-// promise(boost::move(rhs)).swap(*this);
-//#endif
-//
-// return *this;
-// }
-//#else
         promise(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT :
             future_(BOOST_THREAD_RV(rhs).future_),future_obtained(BOOST_THREAD_RV(rhs).future_obtained)
         {
@@ -1191,7 +1152,6 @@
             BOOST_THREAD_RV(rhs).future_obtained=false;
             return *this;
         }
-//#endif
 
         void swap(promise& other)
         {
@@ -1456,13 +1416,9 @@
             task_object(BOOST_THREAD_RV_REF(F) f_):
               f(boost::forward<F>(f_))
             {}
-#elif defined BOOST_THREAD_USES_MOVE
- task_object(BOOST_THREAD_RV_REF(F) f_):
- f(boost::move(f_))
- {}
 #else
             task_object(BOOST_THREAD_RV_REF(F) f_):
- f(f_)
+ f(boost::move(f_))
             {}
 #endif
             void do_run()
@@ -1497,13 +1453,9 @@
             task_object(BOOST_THREAD_RV_REF(F) f_):
               f(boost::forward<F>(f_))
             {}
-#elif defined BOOST_THREAD_USES_MOVE
- task_object(BOOST_THREAD_RV_REF(F) f_):
- f(boost::move(f_))
- {}
 #else
             task_object(BOOST_THREAD_RV_REF(F) f_):
- f(f_)
+ f(boost::move(f_))
             {}
 #endif
 
@@ -1559,17 +1511,10 @@
         explicit packaged_task(F const& f):
             task(new detail::task_object<R,F>(f)),future_obtained(false)
         {}
-#if defined BOOST_THREAD_USES_MOVE
         template <class F>
         explicit packaged_task(BOOST_THREAD_RV_REF(F) f):
             task(new detail::task_object<R,F>(boost::move(f))),future_obtained(false)
         {}
-#else
- template <class F>
- explicit packaged_task(BOOST_THREAD_RV_REF(F) f):
- task(new detail::task_object<R,F>(f)),future_obtained(false)
- {}
-#endif
 #endif
 
 #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
@@ -1607,7 +1552,6 @@
           task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,F>(f), D(a2, 1) );
           future_obtained = false;
         }
-#if defined BOOST_THREAD_USES_MOVE
         template <class F, class Allocator>
         packaged_task(boost::allocator_arg_t, Allocator a, BOOST_THREAD_RV_REF(F) f)
         {
@@ -1618,18 +1562,6 @@
           task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,F>(boost::move(f)), D(a2, 1) );
           future_obtained = false;
         }
-#else
- template <class F, class Allocator>
- packaged_task(boost::allocator_arg_t, Allocator a, BOOST_THREAD_RV_REF(F) f)
- {
- typedef typename Allocator::template rebind<detail::task_object<R,F> >::other A2;
- A2 a2(a);
- typedef thread_detail::allocator_destructor<A2> D;
-
- task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,F>(f), D(a2, 1) );
- future_obtained = false;
- }
-#endif // BOOST_THREAD_USES_MOVE
 #endif //BOOST_NO_RVALUE_REFERENCES
 #endif // BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
 

Modified: trunk/boost/thread/locks.hpp
==============================================================================
--- trunk/boost/thread/locks.hpp (original)
+++ trunk/boost/thread/locks.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -3,6 +3,7 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007 Anthony Williams
 // (C) Copyright 2011-2012 Vicente J. Botet Escriba
+
 #ifndef BOOST_THREAD_LOCKS_HPP
 #define BOOST_THREAD_LOCKS_HPP
 #include <boost/thread/detail/config.hpp>
@@ -1279,18 +1280,16 @@
                 base(::boost::move(other))
             {}
 
-#else
-#if defined BOOST_THREAD_USES_MOVE
- try_lock_wrapper(BOOST_THREAD_RV_REF_BEG try_lock_wrapper<Mutex> BOOST_THREAD_RV_REF_END other):
+#elif defined BOOST_THREAD_USES_MOVE
+ try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
                 base(::boost::move(static_cast<base&>(other)))
             {}
 
 #else
- try_lock_wrapper(BOOST_THREAD_RV_REF_BEG try_lock_wrapper<Mutex> BOOST_THREAD_RV_REF_END other):
+ try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
                 base(BOOST_THREAD_RV_REF(base)(*other))
             {}
 #endif
-#endif
             try_lock_wrapper& operator=(BOOST_THREAD_RV_REF_BEG try_lock_wrapper<Mutex> BOOST_THREAD_RV_REF_END other)
             {
                 try_lock_wrapper temp(other);

Modified: trunk/boost/thread/pthread/mutex.hpp
==============================================================================
--- trunk/boost/thread/pthread/mutex.hpp (original)
+++ trunk/boost/thread/pthread/mutex.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -1,7 +1,7 @@
 #ifndef BOOST_THREAD_PTHREAD_MUTEX_HPP
 #define BOOST_THREAD_PTHREAD_MUTEX_HPP
 // (C) Copyright 2007-8 Anthony Williams
-// (C) Copyright 2011-2012 Vicente J. Botet Escriba
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 // 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)

Modified: trunk/boost/thread/pthread/once.hpp
==============================================================================
--- trunk/boost/thread/pthread/once.hpp (original)
+++ trunk/boost/thread/pthread/once.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -4,6 +4,7 @@
 // once.hpp
 //
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Modified: trunk/boost/thread/pthread/recursive_mutex.hpp
==============================================================================
--- trunk/boost/thread/pthread/recursive_mutex.hpp (original)
+++ trunk/boost/thread/pthread/recursive_mutex.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -1,6 +1,7 @@
 #ifndef BOOST_THREAD_PTHREAD_RECURSIVE_MUTEX_HPP
 #define BOOST_THREAD_PTHREAD_RECURSIVE_MUTEX_HPP
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 // 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)

Modified: trunk/boost/thread/pthread/thread_data.hpp
==============================================================================
--- trunk/boost/thread/pthread/thread_data.hpp (original)
+++ trunk/boost/thread/pthread/thread_data.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -4,6 +4,7 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 
 #include <boost/thread/detail/config.hpp>
 #include <boost/thread/exceptions.hpp>

Modified: trunk/boost/thread/shared_mutex.hpp
==============================================================================
--- trunk/boost/thread/shared_mutex.hpp (original)
+++ trunk/boost/thread/shared_mutex.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -4,6 +4,7 @@
 // shared_mutex.hpp
 //
 // (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Modified: trunk/boost/thread/win32/basic_recursive_mutex.hpp
==============================================================================
--- trunk/boost/thread/win32/basic_recursive_mutex.hpp (original)
+++ trunk/boost/thread/win32/basic_recursive_mutex.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -4,6 +4,7 @@
 // basic_recursive_mutex.hpp
 //
 // (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Modified: trunk/boost/thread/win32/basic_timed_mutex.hpp
==============================================================================
--- trunk/boost/thread/win32/basic_timed_mutex.hpp (original)
+++ trunk/boost/thread/win32/basic_timed_mutex.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -4,6 +4,7 @@
 // basic_timed_mutex_win32.hpp
 //
 // (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Modified: trunk/boost/thread/win32/condition_variable.hpp
==============================================================================
--- trunk/boost/thread/win32/condition_variable.hpp (original)
+++ trunk/boost/thread/win32/condition_variable.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -4,6 +4,7 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/win32/thread_primitives.hpp>
@@ -11,7 +12,6 @@
 #include <boost/assert.hpp>
 #include <algorithm>
 #include <boost/thread/cv_status.hpp>
-//#include <boost/thread/thread.hpp>
 #include <boost/thread/win32/thread_data.hpp>
 #include <boost/thread/thread_time.hpp>
 #include <boost/thread/win32/interlocked_read.hpp>

Modified: trunk/boost/thread/win32/mutex.hpp
==============================================================================
--- trunk/boost/thread/win32/mutex.hpp (original)
+++ trunk/boost/thread/win32/mutex.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -1,6 +1,7 @@
 #ifndef BOOST_THREAD_WIN32_MUTEX_HPP
 #define BOOST_THREAD_WIN32_MUTEX_HPP
 // (C) Copyright 2005-7 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 // 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)

Modified: trunk/boost/thread/win32/once.hpp
==============================================================================
--- trunk/boost/thread/win32/once.hpp (original)
+++ trunk/boost/thread/win32/once.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -5,6 +5,7 @@
 //
 // (C) Copyright 2005-7 Anthony Williams
 // (C) Copyright 2005 John Maddock
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Modified: trunk/boost/thread/win32/shared_mutex.hpp
==============================================================================
--- trunk/boost/thread/win32/shared_mutex.hpp (original)
+++ trunk/boost/thread/win32/shared_mutex.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -2,6 +2,7 @@
 #define BOOST_THREAD_WIN32_SHARED_MUTEX_HPP
 
 // (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Modified: trunk/boost/thread/win32/thread_data.hpp
==============================================================================
--- trunk/boost/thread/win32/thread_data.hpp (original)
+++ trunk/boost/thread/win32/thread_data.hpp 2012-04-22 12:33:46 EDT (Sun, 22 Apr 2012)
@@ -4,6 +4,7 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2008 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 
 #include <boost/thread/detail/config.hpp>
 #include <boost/intrusive_ptr.hpp>


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