Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57173 - trunk/boost/thread
From: anthony_at_[hidden]
Date: 2009-10-27 09:22:08


Author: anthonyw
Date: 2009-10-27 09:22:08 EDT (Tue, 27 Oct 2009)
New Revision: 57173
URL: http://svn.boost.org/trac/boost/changeset/57173

Log:
More fixes for compilers with rvalue ref support
Text files modified:
   trunk/boost/thread/locks.hpp | 37 ++++++++++++++++++++++++++-----------
   1 files changed, 26 insertions(+), 11 deletions(-)

Modified: trunk/boost/thread/locks.hpp
==============================================================================
--- trunk/boost/thread/locks.hpp (original)
+++ trunk/boost/thread/locks.hpp 2009-10-27 09:22:08 EDT (Tue, 27 Oct 2009)
@@ -263,16 +263,16 @@
         }
 
 
- unique_lock& operator=(unique_lock<Mutex>&& other)
+ unique_lock& operator=(unique_lock&& other)
         {
- unique_lock temp(std::move(other));
+ unique_lock temp(other.move());
             swap(temp);
             return *this;
         }
 
         unique_lock& operator=(upgrade_lock<Mutex>&& other)
         {
- unique_lock temp(std::move(other));
+ unique_lock temp(other.move());
             swap(temp);
             return *this;
         }
@@ -783,7 +783,7 @@
         other.is_locked=false;
         if(is_locked)
         {
- m.unlock_upgrade_and_lock();
+ m->unlock_upgrade_and_lock();
         }
     }
 #else
@@ -875,6 +875,28 @@
             try_lock_wrapper(Mutex& m_,try_to_lock_t):
                 base(m_,try_to_lock)
             {}
+#ifdef BOOST_HAS_RVALUE_REFS
+ try_lock_wrapper(try_lock_wrapper&& other):
+ base(other.move())
+ {}
+
+ try_lock_wrapper&& move()
+ {
+ return static_cast<try_lock_wrapper&&>(*this);
+ }
+
+ try_lock_wrapper& operator=(try_lock_wrapper<Mutex>&& other)
+ {
+ try_lock_wrapper temp(other.move());
+ swap(temp);
+ return *this;
+ }
+
+ void swap(try_lock_wrapper&& other)
+ {
+ base::swap(other);
+ }
+#else
             try_lock_wrapper(detail::thread_move_t<try_lock_wrapper<Mutex> > other):
                 base(detail::thread_move_t<base>(*other))
             {}
@@ -896,12 +918,6 @@
                 return *this;
             }
 
-#ifdef BOOST_HAS_RVALUE_REFS
- void swap(try_lock_wrapper&& other)
- {
- base::swap(other);
- }
-#else
             void swap(try_lock_wrapper& other)
             {
                 base::swap(other);
@@ -911,7 +927,6 @@
                 base::swap(*other);
             }
 #endif
-
             void lock()
             {
                 base::lock();


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