Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85195 - in trunk: boost/thread libs/thread/doc
From: vicente.botet_at_[hidden]
Date: 2013-08-03 03:47:18


Author: viboes
Date: 2013-08-03 03:47:18 EDT (Sat, 03 Aug 2013)
New Revision: 85195
URL: http://svn.boost.org/trac/boost/changeset/85195

Log:
Thread: Add mutex() to upgrade_to_unique_lock (#8891).

Text files modified:
   trunk/boost/thread/lock_types.hpp | 6 +++++-
   trunk/libs/thread/doc/mutex_concepts.qbk | 10 ++++++----
   2 files changed, 11 insertions(+), 5 deletions(-)

Modified: trunk/boost/thread/lock_types.hpp
==============================================================================
--- trunk/boost/thread/lock_types.hpp Sat Aug 3 03:44:15 2013 (r85194)
+++ trunk/boost/thread/lock_types.hpp 2013-08-03 03:47:18 EDT (Sat, 03 Aug 2013) (r85195)
@@ -1112,6 +1112,10 @@
     {
       return exclusive.owns_lock();
     }
+ Mutex* mutex() const BOOST_NOEXCEPT
+ {
+ return exclusive.mutex();
+ }
   };
 
 BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) upgrade_to_unique_lock<Mutex> BOOST_THREAD_DCL_MOVABLE_END
@@ -1187,7 +1191,7 @@
     {
       return base::owns_lock();
     }
- Mutex* mutex() const
+ Mutex* mutex() const BOOST_NOEXCEPT
     {
       return base::mutex();
     }

Modified: trunk/libs/thread/doc/mutex_concepts.qbk
==============================================================================
--- trunk/libs/thread/doc/mutex_concepts.qbk Sat Aug 3 03:44:15 2013 (r85194)
+++ trunk/libs/thread/doc/mutex_concepts.qbk 2013-08-03 03:47:18 EDT (Sat, 03 Aug 2013) (r85195)
@@ -1273,7 +1273,7 @@
         explicit operator bool() const noexcept;
         bool owns_lock() const noexcept;
 
- Lockable* mutex() const noexcept;
+ mutex_type* mutex() const noexcept;
 
     #if defined BOOST_THREAD_USE_DATE_TIME || defined BOOST_THREAD_DONT_USE_CHRONO
         unique_lock(Lockable& m_,system_time const& target_time);
@@ -1535,7 +1535,7 @@
 
 [endsect]
 
-[section:mutex `Lockable* mutex() const`]
+[section:mutex `Lockable* mutex() const noexcept`]
 
 [variablelist
 
@@ -1907,7 +1907,7 @@
 
 [endsect]
 
-[section:upgrade_to_unique_lock Class template `upgrade_to_unique_lock`]
+[section:upgrade_to_unique_lock Class template `upgrade_to_unique_lock` -- EXTENSION]
 
     // #include <boost/thread/locks.hpp>
     // #include <boost/thread/lock_types.hpp>
@@ -1930,6 +1930,8 @@
 
         explicit operator bool() const;
         bool owns_lock() const;
+ mutex_type* mutex() const;
+
     };
 
 __upgrade_to_unique_lock__ allows for a temporary upgrade of an __upgrade_lock__ to exclusive ownership. When constructed with a
@@ -1939,7 +1941,7 @@
 
 [endsect]
 
-[section:scoped_try_lock Mutex-specific class `scoped_try_lock`]
+[section:scoped_try_lock Mutex-specific class `scoped_try_lock` -- DEPRECATED]
 
     class MutexType::scoped_try_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