Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78086 - in trunk: boost/thread boost/thread/detail libs/thread/test/sync/conditions/condition_variable
From: vicente.botet_at_[hidden]
Date: 2012-04-19 18:19:53


Author: viboes
Date: 2012-04-19 18:19:52 EDT (Thu, 19 Apr 2012)
New Revision: 78086
URL: http://svn.boost.org/trac/boost/changeset/78086

Log:
Thread: Fix issue with macro BOOST_THREAD_RV_REF and the use of templates as arguments, see with Sun compiler
Text files modified:
   trunk/boost/thread/detail/move.hpp | 10 ++++++
   trunk/boost/thread/future.hpp | 6 ++--
   trunk/boost/thread/locks.hpp | 54 ++++++++++++++++++++--------------------
   trunk/libs/thread/test/sync/conditions/condition_variable/default_pass.cpp | 1
   4 files changed, 39 insertions(+), 32 deletions(-)

Modified: trunk/boost/thread/detail/move.hpp
==============================================================================
--- trunk/boost/thread/detail/move.hpp (original)
+++ trunk/boost/thread/detail/move.hpp 2012-04-19 18:19:52 EDT (Thu, 19 Apr 2012)
@@ -64,6 +64,8 @@
 #if ! defined BOOST_NO_RVALUE_REFERENCES
 
 #define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
+#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
 #define BOOST_THREAD_RV(V) V
 #define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE
 #define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
@@ -71,6 +73,8 @@
 #elif ! defined BOOST_NO_RVALUE_REFERENCES && defined BOOST_MSVC
 
 #define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
+#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
 #define BOOST_THREAD_RV(V) V
 #define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE
 #define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
@@ -79,12 +83,16 @@
 
 #if defined BOOST_THREAD_USES_MOVE
 #define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
+#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
 #define BOOST_THREAD_RV(V) V
 #define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
 
 #else
 
-#define BOOST_THREAD_RV_REF(TYPE) boost::detail::thread_move_t<TYPE>
+#define BOOST_THREAD_RV_REF(TYPE) boost::detail::thread_move_t< TYPE >
+#define BOOST_THREAD_RV_REF_BEG boost::detail::thread_move_t<
+#define BOOST_THREAD_RV_REF_END >
 #define BOOST_THREAD_RV(V) (*V)
 #define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
 #endif

Modified: trunk/boost/thread/future.hpp
==============================================================================
--- trunk/boost/thread/future.hpp (original)
+++ trunk/boost/thread/future.hpp 2012-04-19 18:19:52 EDT (Thu, 19 Apr 2012)
@@ -982,7 +982,7 @@
 // {
 // future_.swap(BOOST_THREAD_RV(other).future_);
 // }
-// shared_future(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE<R>) other) BOOST_NOEXCEPT
+// 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_);
 // }
@@ -992,7 +992,7 @@
         {
             BOOST_THREAD_RV(other).future_.reset();
         }
- shared_future(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE<R>) other) BOOST_NOEXCEPT :
+ shared_future(BOOST_THREAD_RV_REF_BEG BOOST_THREAD_FUTURE<R> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT :
             future_(BOOST_THREAD_RV(other).future_)
         {
             BOOST_THREAD_RV(other).future_.reset();
@@ -1004,7 +1004,7 @@
             BOOST_THREAD_RV(other).future_.reset();
             return *this;
         }
- shared_future& operator=(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE<R>) other) BOOST_NOEXCEPT
+ shared_future& operator=(BOOST_THREAD_RV_REF_BEG BOOST_THREAD_FUTURE<R> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
             future_.swap(BOOST_THREAD_RV(other).future_);
             BOOST_THREAD_RV(other).future_.reset();

Modified: trunk/boost/thread/locks.hpp
==============================================================================
--- trunk/boost/thread/locks.hpp (original)
+++ trunk/boost/thread/locks.hpp 2012-04-19 18:19:52 EDT (Thu, 19 Apr 2012)
@@ -341,10 +341,10 @@
           BOOST_THREAD_RV(other).is_locked=false;
           BOOST_THREAD_RV(other).m=0;
         }
- BOOST_THREAD_EXPLICIT_LOCK_CONVERSION unique_lock(BOOST_THREAD_RV_REF(upgrade_lock<Mutex>) other);
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other);
 
 #ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
- unique_lock& operator=(BOOST_THREAD_RV_REF(upgrade_lock<Mutex>) other) BOOST_NOEXCEPT
+ unique_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
             unique_lock temp(::boost::move(other));
             swap(temp);
@@ -369,7 +369,7 @@
 #endif
 
         // Conversion from upgrade locking
- unique_lock(BOOST_THREAD_RV_REF(upgrade_lock<mutex_type>) ul, try_to_lock_t)
+ unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<mutex_type> BOOST_THREAD_RV_REF_END ul, try_to_lock_t)
         : m(0),is_locked(false)
         {
             if (BOOST_THREAD_RV(ul).owns_lock()) {
@@ -387,7 +387,7 @@
 
 #ifdef BOOST_THREAD_USES_CHRONO
         template <class Clock, class Duration>
- unique_lock(BOOST_THREAD_RV_REF(upgrade_lock<mutex_type>) ul,
+ unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<mutex_type> BOOST_THREAD_RV_REF_END ul,
                     const chrono::time_point<Clock, Duration>& abs_time)
         : m(0),is_locked(false)
         {
@@ -405,7 +405,7 @@
         }
 
         template <class Rep, class Period>
- unique_lock(BOOST_THREAD_RV_REF(upgrade_lock<mutex_type>) ul,
+ unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<mutex_type> BOOST_THREAD_RV_REF_END ul,
                     const chrono::duration<Rep, Period>& rel_time)
         : m(0),is_locked(false)
         {
@@ -425,7 +425,7 @@
 
 #ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
         // Conversion from shared locking
- unique_lock(BOOST_THREAD_RV_REF(shared_lock<mutex_type>) sl, try_to_lock_t)
+ unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl, try_to_lock_t)
         : m(0),is_locked(false)
         {
           if (BOOST_THREAD_RV(sl).owns_lock()) {
@@ -443,7 +443,7 @@
 
 #ifdef BOOST_THREAD_USES_CHRONO
         template <class Clock, class Duration>
- unique_lock(BOOST_THREAD_RV_REF(shared_lock<mutex_type>) sl,
+ unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
                     const chrono::time_point<Clock, Duration>& abs_time)
         : m(0),is_locked(false)
         {
@@ -461,7 +461,7 @@
         }
 
         template <class Rep, class Period>
- unique_lock(BOOST_THREAD_RV_REF(shared_lock<mutex_type>) sl,
+ unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
                     const chrono::duration<Rep, Period>& rel_time)
         : m(0),is_locked(false)
         {
@@ -709,14 +709,14 @@
         }
 #endif
 
- shared_lock(BOOST_THREAD_RV_REF(shared_lock<Mutex>) other) BOOST_NOEXCEPT:
+ shared_lock(BOOST_THREAD_RV_REF_BEG shared_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
             m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
         {
             BOOST_THREAD_RV(other).is_locked=false;
             BOOST_THREAD_RV(other).m=0;
         }
 
- BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF(unique_lock<Mutex>) other):
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other):
             m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
         {
             if(is_locked)
@@ -727,7 +727,7 @@
             BOOST_THREAD_RV(other).m=0;
         }
 
- BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF(upgrade_lock<Mutex>) other):
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other):
             m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
         {
             if(is_locked)
@@ -739,21 +739,21 @@
         }
 
 
- shared_lock& operator=(BOOST_THREAD_RV_REF(shared_lock<Mutex>) other) BOOST_NOEXCEPT
+ shared_lock& operator=(BOOST_THREAD_RV_REF_BEG shared_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
             shared_lock temp(::boost::move(other));
             swap(temp);
             return *this;
         }
 #ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
- shared_lock& operator=(BOOST_THREAD_RV_REF(unique_lock<Mutex>) other)
+ shared_lock& operator=(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other)
         {
             shared_lock temp(::boost::move(other));
             swap(temp);
             return *this;
         }
 
- shared_lock& operator=(BOOST_THREAD_RV_REF(upgrade_lock<Mutex>) other)
+ shared_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other)
         {
             shared_lock temp(::boost::move(other));
             swap(temp);
@@ -966,14 +966,14 @@
         }
 #endif
 
- upgrade_lock(BOOST_THREAD_RV_REF(upgrade_lock<Mutex>) other) BOOST_NOEXCEPT:
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
             m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
         {
             BOOST_THREAD_RV(other).is_locked=false;
             BOOST_THREAD_RV(other).m=0;
         }
 
- BOOST_THREAD_EXPLICIT_LOCK_CONVERSION upgrade_lock(BOOST_THREAD_RV_REF(unique_lock<Mutex>) other):
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION upgrade_lock(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other):
             m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
         {
             if(is_locked)
@@ -984,7 +984,7 @@
             BOOST_THREAD_RV(other).m=0;
         }
 
- upgrade_lock& operator=(BOOST_THREAD_RV_REF(upgrade_lock<Mutex>) other) BOOST_NOEXCEPT
+ upgrade_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
             upgrade_lock temp(::boost::move(other));
             swap(temp);
@@ -992,7 +992,7 @@
         }
 
 #ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
- upgrade_lock& operator=(BOOST_THREAD_RV_REF(unique_lock<Mutex>) other)
+ upgrade_lock& operator=(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other)
         {
             upgrade_lock temp(::boost::move(other));
             swap(temp);
@@ -1002,7 +1002,7 @@
 
 #ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
         // Conversion from shared locking
- upgrade_lock(BOOST_THREAD_RV_REF(shared_lock<mutex_type>) sl, try_to_lock_t)
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl, try_to_lock_t)
         : m(0),is_locked(false)
         {
           if (BOOST_THREAD_RV(sl).owns_lock()) {
@@ -1020,7 +1020,7 @@
 
 #ifdef BOOST_THREAD_USES_CHRONO
         template <class Clock, class Duration>
- upgrade_lock(BOOST_THREAD_RV_REF(shared_lock<mutex_type>) sl,
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
                          const chrono::time_point<Clock, Duration>& abs_time)
         : m(0),is_locked(false)
         {
@@ -1038,7 +1038,7 @@
         }
 
         template <class Rep, class Period>
- upgrade_lock(BOOST_THREAD_RV_REF(shared_lock<mutex_type>) sl,
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
                          const chrono::duration<Rep, Period>& rel_time)
         : m(0),is_locked(false)
         {
@@ -1189,7 +1189,7 @@
 
 
     template<typename Mutex>
- unique_lock<Mutex>::unique_lock(BOOST_THREAD_RV_REF(upgrade_lock<Mutex>) other):
+ unique_lock<Mutex>::unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other):
         m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
     {
         if(is_locked)
@@ -1221,13 +1221,13 @@
             }
         }
 
- upgrade_to_unique_lock(BOOST_THREAD_RV_REF(upgrade_to_unique_lock<Mutex>) other) BOOST_NOEXCEPT:
+ upgrade_to_unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_to_unique_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
             source(BOOST_THREAD_RV(other).source),exclusive(::boost::move(BOOST_THREAD_RV(other).exclusive))
         {
             BOOST_THREAD_RV(other).source=0;
         }
 
- upgrade_to_unique_lock& operator=(BOOST_THREAD_RV_REF(upgrade_to_unique_lock<Mutex>) other) BOOST_NOEXCEPT
+ upgrade_to_unique_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_to_unique_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
             upgrade_to_unique_lock temp(other);
             swap(temp);
@@ -1303,17 +1303,17 @@
 
 #else
 #if defined BOOST_THREAD_USES_MOVE
- try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper<Mutex>) other):
+ try_lock_wrapper(BOOST_THREAD_RV_REF_BEG try_lock_wrapper<Mutex> BOOST_THREAD_RV_REF_END other):
                 base(::boost::move(static_cast<base&>(other)))
             {}
 
 #else
- try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper<Mutex>) other):
+ try_lock_wrapper(BOOST_THREAD_RV_REF_BEG try_lock_wrapper<Mutex> BOOST_THREAD_RV_REF_END other):
                 base(BOOST_THREAD_RV_REF(base)(*other))
             {}
 #endif
 #endif
- try_lock_wrapper& operator=(BOOST_THREAD_RV_REF(try_lock_wrapper<Mutex>) other)
+ try_lock_wrapper& operator=(BOOST_THREAD_RV_REF_BEG try_lock_wrapper<Mutex> BOOST_THREAD_RV_REF_END other)
             {
                 try_lock_wrapper temp(other);
                 swap(temp);

Modified: trunk/libs/thread/test/sync/conditions/condition_variable/default_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/conditions/condition_variable/default_pass.cpp (original)
+++ trunk/libs/thread/test/sync/conditions/condition_variable/default_pass.cpp 2012-04-19 18:19:52 EDT (Thu, 19 Apr 2012)
@@ -25,4 +25,3 @@
   boost::condition_variable cv0;
   return boost::report_errors();
 }
-


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