Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77136 - trunk/libs/thread/doc
From: vicente.botet_at_[hidden]
Date: 2012-02-28 13:49:23


Author: viboes
Date: 2012-02-28 13:49:22 EST (Tue, 28 Feb 2012)
New Revision: 77136
URL: http://svn.boost.org/trac/boost/changeset/77136

Log:
Thread: Update doc removing thread_move_t
Text files modified:
   trunk/libs/thread/doc/mutex_concepts.qbk | 107 ++++++++++++++++++++++++++-------------
   trunk/libs/thread/doc/thread_ref.qbk | 14 +---
   2 files changed, 75 insertions(+), 46 deletions(-)

Modified: trunk/libs/thread/doc/mutex_concepts.qbk
==============================================================================
--- trunk/libs/thread/doc/mutex_concepts.qbk (original)
+++ trunk/libs/thread/doc/mutex_concepts.qbk 2012-02-28 13:49:22 EST (Tue, 28 Feb 2012)
@@ -445,6 +445,7 @@
     class unique_lock
     {
     public:
+ typedef Lockable mutex_type;
         unique_lock() noexcept;
         explicit unique_lock(Lockable& m_);
         unique_lock(Lockable& m_,adopt_lock_t);
@@ -458,20 +459,16 @@
         unique_lock(Mutex& mtx, const chrono::duration<Rep, Period>& d);
         ~unique_lock();
 
+ unique_lock(unique_lock const&) = delete;
+ unique_lock& operator=(unique_lock const&) = delete;
         unique_lock(unique_lock<Lockable>&& other) noexcept;
- unique_lock(detail::thread_move_t<unique_lock<Lockable> > other) noexcept;
         unique_lock(upgrade_lock<Lockable>&& other) noexcept;
- unique_lock(detail::thread_move_t<upgrade_lock<Lockable> > other) noexcept;
 
- operator detail::thread_move_t<unique_lock<Lockable> >();
- detail::thread_move_t<unique_lock<Lockable> > move();
         unique_lock& operator=(unique_lock<Lockable>&& other) noexcept;
- unique_lock& operator=(detail::thread_move_t<unique_lock<Lockable> > other) noexcept;
         unique_lock& operator=(upgrade_lock<Lockable>&& other) noexcept;
- unique_lock& operator=(detail::thread_move_t<upgrade_lock<Lockable> > other) noexcept;
 
         void swap(unique_lock& other) noexcept;
- void swap(detail::thread_move_t<unique_lock<Lockable> > other) noexcept;
+ Lockable* release() noexcept;
 
         void lock();
         bool try_lock();
@@ -487,12 +484,14 @@
         void unlock();
 
         bool owns_lock() const noexcept;
- explicit operator bool() const noexcept;
+ #if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
         operator ``['unspecified-bool-type]``() const noexcept;
         bool operator!() const noexcept;
+ #else
+ explicit operator bool() const noexcept;
+ #endif
 
         Lockable* mutex() const noexcept;
- Lockable* release() noexcept;
     };
 
 __unique_lock__ is more complex than __lock_guard__: not only does it provide for RAII-style locking, it also allows for deferring
@@ -500,7 +499,7 @@
 fashion, or with a timeout. Consequently, __unlock_ref__ is only called in the destructor if the lock object has locked the
 __lockable_concept_type__ object, or otherwise adopted a lock on the __lockable_concept_type__ object.
 
-Specializations of __unique_lock__ model the __timed_lockable_concept__ if the supplied __lockable_concept_type__ type itself models
+Specializations of __unique_lock__ model the __timed_lockable_concept__ if the supplied Lockable type itself models
 __timed_lockable_concept__ (e.g. `boost::unique_lock<boost::timed_mutex>`), or the __lockable_concept__ otherwise
 (e.g. `boost::unique_lock<boost::mutex>`).
 
@@ -686,13 +685,11 @@
 
 [endsect]
 
-[section:bool_conversion `operator unspecified-bool-type() const`]
+[section:explicit_bool_conversion `explicit operator bool() const`]
 
 [variablelist
 
-[[Returns:] [If __owns_lock_ref__ would return `true`, a value that evaluates to
-`true` in boolean contexts, otherwise a value that evaluates to `false` in
-boolean contexts.]]
+[[Returns:] [`__owns_lock_ref__()`.]]
 
 [[Throws:] [Nothing.]]
 
@@ -700,11 +697,13 @@
 
 [endsect]
 
-[section:explicit_bool_conversion `explicit operator bool() const`]
+[section:bool_conversion `operator unspecified-bool-type() const`]
 
 [variablelist
 
-[[Returns:] [`__owns_lock_ref__()`.]]
+[[Returns:] [If __owns_lock_ref__ would return `true`, a value that evaluates to
+`true` in boolean contexts, otherwise a value that evaluates to `false` in
+boolean contexts.]]
 
 [[Throws:] [Nothing.]]
 
@@ -712,6 +711,7 @@
 
 [endsect]
 
+
 [section:operator_not `bool operator!() const`]
 
 [variablelist
@@ -754,24 +754,25 @@
     class shared_lock
     {
     public:
+ typedef Lockable mutex_type;
         shared_lock();
         explicit shared_lock(Lockable& m_);
         shared_lock(Lockable& m_,adopt_lock_t);
         shared_lock(Lockable& m_,defer_lock_t);
         shared_lock(Lockable& m_,try_to_lock_t);
         shared_lock(Lockable& m_,system_time const& target_time);
- shared_lock(detail::thread_move_t<shared_lock<Lockable> > other);
- shared_lock(detail::thread_move_t<unique_lock<Lockable> > other);
- shared_lock(detail::thread_move_t<upgrade_lock<Lockable> > other);
-
         ~shared_lock();
 
- operator detail::thread_move_t<shared_lock<Lockable> >();
- detail::thread_move_t<shared_lock<Lockable> > move();
+ shared_lock(shared_lock const&) = delete;
+ shared_lock& operator=(shared_lock const&) = delete;
 
- shared_lock& operator=(detail::thread_move_t<shared_lock<Lockable> > other);
- shared_lock& operator=(detail::thread_move_t<unique_lock<Lockable> > other);
- shared_lock& operator=(detail::thread_move_t<upgrade_lock<Lockable> > other);
+ shared_lock(shared_lock<Lockable> && other);
+ shared_lock(unique_lock<Lockable> && other);
+ shared_lock(upgrade_lock<Lockable> && other);
+
+ shared_lock& operator=(shared_lock<Lockable> && other);
+ shared_lock& operator=(unique_lock<Lockable> && other);
+ shared_lock& operator=(upgrade_lock<Lockable> && other);
         void swap(shared_lock& other);
 
         void lock();
@@ -779,8 +780,12 @@
         bool timed_lock(boost::system_time const& target_time);
         void unlock();
 
+ #if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
         operator ``['unspecified-bool-type]``() const;
         bool operator!() const;
+ #else
+ explicit operator bool() const;
+ #endif
         bool owns_lock() const;
     };
 
@@ -959,6 +964,18 @@
 
 [endsect]
 
+[section:explicit_operator_bool `explicit operator bool() const`]
+
+[variablelist
+
+[[Returns:] [__owns_lock_shared_ref__.]]
+
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+
 [section:release `Lockable* release()`]
 
 [variablelist
@@ -989,26 +1006,31 @@
     class upgrade_lock
     {
     public:
+ typedef Lockable mutex_type;
         explicit upgrade_lock(Lockable& m_);
 
- upgrade_lock(detail::thread_move_t<upgrade_lock<Lockable> > other);
- upgrade_lock(detail::thread_move_t<unique_lock<Lockable> > other);
+ upgrade_lock(upgrade_lock<Lockable> && other);
+ upgrade_lock(unique_lock<Lockable> && other);
 
         ~upgrade_lock();
 
- operator detail::thread_move_t<upgrade_lock<Lockable> >();
- detail::thread_move_t<upgrade_lock<Lockable> > move();
+ upgrade_lock(const upgrade_lock& other) = delete;
+ upgrade_lock& operator=(const upgrade_lock<Lockable> & other) = delete;
 
- upgrade_lock& operator=(detail::thread_move_t<upgrade_lock<Lockable> > other);
- upgrade_lock& operator=(detail::thread_move_t<unique_lock<Lockable> > other);
+ upgrade_lock& operator=(upgrade_lock<Lockable> && other);
+ upgrade_lock& operator=(unique_lock<Lockable> && other);
 
         void swap(upgrade_lock& other);
 
         void lock();
         void unlock();
 
+ #if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
         operator ``['unspecified-bool-type]``() const;
         bool operator!() const;
+ #else
+ explicit operator bool() const;
+ #endif
         bool owns_lock() const;
     };
 
@@ -1038,16 +1060,24 @@
     class upgrade_to_unique_lock
     {
     public:
+ typedef Lockable mutex_type;
         explicit upgrade_to_unique_lock(upgrade_lock<Lockable>& m_);
-
         ~upgrade_to_unique_lock();
 
- upgrade_to_unique_lock(detail::thread_move_t<upgrade_to_unique_lock<Lockable> > other);
- upgrade_to_unique_lock& operator=(detail::thread_move_t<upgrade_to_unique_lock<Lockable> > other);
+ upgrade_to_unique_lock(upgrade_to_unique_lock const& other) = delete;
+ upgrade_to_unique_lock& operator=(upgrade_to_unique_lock<Lockable> const& other) = delete;
+
+ upgrade_to_unique_lock(upgrade_to_unique_lock<Lockable> && other);
+ upgrade_to_unique_lock& operator=(upgrade_to_unique_lock<Lockable> && other);
+
         void swap(upgrade_to_unique_lock& other);
 
+ #if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
         operator ``['unspecified-bool-type]``() const;
         bool operator!() const;
+ #else
+ explicit operator bool() const;
+ #endif
         bool owns_lock() const;
     };
 
@@ -1084,10 +1114,13 @@
 
         MutexType* mutex() const;
         MutexType* release();
- bool operator!() const;
 
- typedef ``['unspecified-bool-type]`` bool_type;
- operator bool_type() const;
+ #if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
+ operator ``['unspecified-bool-type]``() const;
+ bool operator!() const;
+ #else
+ explicit operator bool() const;
+ #endif
     };
 
 The member typedef `scoped_try_lock` is provided for each distinct

Modified: trunk/libs/thread/doc/thread_ref.qbk
==============================================================================
--- trunk/libs/thread/doc/thread_ref.qbk (original)
+++ trunk/libs/thread/doc/thread_ref.qbk 2012-02-28 13:49:22 EST (Tue, 28 Feb 2012)
@@ -363,15 +363,13 @@
         thread(F f,A1 a1,A2 a2,...);
 
         template <class F>
- thread(detail::thread_move_t<F> f);
+ thread(F &&f);
 
         template <class F, class ...Args> explicit thread(F&& f, Args&&... args);
 
         // move support
- thread(detail::thread_move_t<thread> x);
- thread& operator=(detail::thread_move_t<thread> x);
- operator detail::thread_move_t<thread>();
- detail::thread_move_t<thread> move();
+ thread(thread && x);
+ thread& operator=(thread && x);
 
         void swap(thread& x) noexcept;
 
@@ -408,7 +406,6 @@
     };
 
     void swap(thread& lhs,thread& rhs) noexcep;
- detail::thread_move_t<thread> move(detail::thread_move_t<thread> t);
 
 [section:default_constructor Default Constructor]
 
@@ -427,7 +424,6 @@
 [section:move_constructor Move Constructor]
 
     thread(thread&& other) noexcept;
- thread(detail::thread_move_t<thread> other);
 
 [variablelist
 
@@ -444,7 +440,6 @@
 [section:move_assignment Move assignment operator]
 
     thread& operator=(thread&& other) noexcept;
- thread& operator=(detail::thread_move_t<thread> other);
 
 [variablelist
 
@@ -863,6 +858,7 @@
 
 [endsect]
 
+[/
 [section:non_member_move Non-member function `move()`]
 
     #include <boost/thread/thread.hpp>
@@ -882,7 +878,7 @@
     boost::thread t2(boost::move(t)); // transfer thread from t to t2
 
 [endsect]
-
+]
 
 [section:id Class `boost::thread::id`]
 


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