Boost logo

Boost-Commit :

From: anthony_at_[hidden]
Date: 2008-07-25 17:30:37


Author: anthonyw
Date: 2008-07-25 17:30:37 EDT (Fri, 25 Jul 2008)
New Revision: 47814
URL: http://svn.boost.org/trac/boost/changeset/47814

Log:
Added a description for the scoped_try_lock typedefs
Text files modified:
   trunk/libs/thread/doc/mutex_concepts.qbk | 42 ++++++++++++++++++++++++++++++++++++++++
   1 files changed, 42 insertions(+), 0 deletions(-)

Modified: trunk/libs/thread/doc/mutex_concepts.qbk
==============================================================================
--- trunk/libs/thread/doc/mutex_concepts.qbk (original)
+++ trunk/libs/thread/doc/mutex_concepts.qbk 2008-07-25 17:30:37 EDT (Fri, 25 Jul 2008)
@@ -931,4 +931,46 @@
 
 [endsect]
 
+[section:scoped_try_lock Mutex-specific class `scoped_try_lock`]
+
+ class MutexType::scoped_try_lock
+ {
+ private:
+ MutexType::scoped_try_lock(MutexType::scoped_try_lock<MutexType>& other);
+ MutexType::scoped_try_lock& operator=(MutexType::scoped_try_lock<MutexType>& other);
+ public:
+ MutexType::scoped_try_lock();
+ explicit MutexType::scoped_try_lock(MutexType& m);
+ MutexType::scoped_try_lock(MutexType& m_,adopt_lock_t);
+ MutexType::scoped_try_lock(MutexType& m_,defer_lock_t);
+ MutexType::scoped_try_lock(MutexType& m_,try_to_lock_t);
+
+ MutexType::scoped_try_lock(MutexType::scoped_try_lock<MutexType>&& other);
+ MutexType::scoped_try_lock& operator=(MutexType::scoped_try_lock<MutexType>&& other);
+
+ void swap(MutexType::scoped_try_lock&& other);
+
+ void lock();
+ bool try_lock();
+ void unlock();
+ bool owns_lock() const;
+
+ MutexType* mutex() const;
+ MutexType* release();
+ bool operator!() const;
+
+ typedef ``['unspecified-bool-type]`` bool_type;
+ operator bool_type() const;
+ };
+
+The member typedef `scoped_try_lock` is provided for each distinct
+`MutexType` as a typedef to a class with the preceding definition. The
+semantics of each constructor and member function are identical to
+those of [unique_lock_link `boost::unique_lock<MutexType>`] for the same `MutexType`, except
+that the constructor that takes a single reference to a mutex will
+call [try_lock_ref_link `m.try_lock()`] rather than `m.lock()`.
+
+
+[endsect]
+
 [endsect]


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