Boost logo

Boost-Commit :

From: anthony_at_[hidden]
Date: 2008-06-05 08:25:59


Author: anthonyw
Date: 2008-06-05 08:25:58 EDT (Thu, 05 Jun 2008)
New Revision: 46164
URL: http://svn.boost.org/trac/boost/changeset/46164

Log:
Added swap for try_lock_wrapper
Text files modified:
   trunk/boost/thread/locks.hpp | 6 ++++++
   trunk/libs/thread/test/test_lock_concept.cpp | 3 ++-
   2 files changed, 8 insertions(+), 1 deletions(-)

Modified: trunk/boost/thread/locks.hpp
==============================================================================
--- trunk/boost/thread/locks.hpp (original)
+++ trunk/boost/thread/locks.hpp 2008-06-05 08:25:58 EDT (Thu, 05 Jun 2008)
@@ -729,6 +729,12 @@
                 return static_cast<base const&>(*this);
             }
         };
+
+ template<typename Mutex>
+ void swap(try_lock_wrapper<Mutex>& lhs,try_lock_wrapper<Mutex>& rhs)
+ {
+ lhs.swap(rhs);
+ }
         
         template<typename MutexType1,typename MutexType2>
         unsigned try_lock_internal(MutexType1& m1,MutexType2& m2)

Modified: trunk/libs/thread/test/test_lock_concept.cpp
==============================================================================
--- trunk/libs/thread/test/test_lock_concept.cpp (original)
+++ trunk/libs/thread/test/test_lock_concept.cpp 2008-06-05 08:25:58 EDT (Thu, 05 Jun 2008)
@@ -1,4 +1,4 @@
-// (C) Copyright 2006-7 Anthony Williams
+// (C) Copyright 2006-8 Anthony Williams
 // 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)
@@ -255,6 +255,7 @@
     test_throws_if_lock_called_when_already_locked<Mutex,Lock>()();
     test_throws_if_try_lock_called_when_already_locked<Mutex,Lock>()();
     test_throws_if_unlock_called_when_already_unlocked<Mutex,Lock>()();
+ test_locks_can_be_swapped<Mutex,Lock>()();
 }
 
 boost::unit_test_framework::test_suite* init_unit_test_suite(int, char*[])


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