|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51259 - in sandbox/synchro/boost/synchro: . lockers poly process thread
From: vicente.botet_at_[hidden]
Date: 2009-02-15 11:02:24
Author: viboes
Date: 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
New Revision: 51259
URL: http://svn.boost.org/trac/boost/changeset/51259
Log:
Boost.Synchro V0.0.0
Completing the Concepts tests
Replacing noncopyable by DELETE macros
Text files modified:
sandbox/synchro/boost/synchro/lockable_adapter.hpp | 26 +++++++++++--
sandbox/synchro/boost/synchro/lockable_concepts.hpp | 48 ++++++++++++++++++++---
sandbox/synchro/boost/synchro/locker_concepts.hpp | 77 +++++++++++++++++++++++++++++++++++++-
sandbox/synchro/boost/synchro/lockers/locking_ptr.hpp | 53 ++++++++++++++++++++++----
sandbox/synchro/boost/synchro/lockers/nested_reverse_locker.hpp | 10 +++--
sandbox/synchro/boost/synchro/lockers/on_dereference_locking_ptr.hpp | 12 +++++-
sandbox/synchro/boost/synchro/lockers/reverse_locker.hpp | 5 ++
sandbox/synchro/boost/synchro/lockers/strict_locker.hpp | 61 ++++++------------------------
sandbox/synchro/boost/synchro/null_mutex.hpp | 38 ++++++++++++++++--
sandbox/synchro/boost/synchro/poly/lock.hpp | 29 ++++++++++++++
sandbox/synchro/boost/synchro/poly/lock_adapter.hpp | 79 +++++++++++++++++++++++++++++----------
sandbox/synchro/boost/synchro/process/mutex.hpp | 4 +-
sandbox/synchro/boost/synchro/process/named_mutex.hpp | 4 +-
sandbox/synchro/boost/synchro/process/named_upgradable_mutex.hpp | 20 ++++++++-
sandbox/synchro/boost/synchro/process/recursive_mutex.hpp | 4 +-
sandbox/synchro/boost/synchro/process/upgradable_mutex.hpp | 27 ++++++++++---
sandbox/synchro/boost/synchro/thread/shared_mutex.hpp | 6 +++
17 files changed, 383 insertions(+), 120 deletions(-)
Modified: sandbox/synchro/boost/synchro/lockable_adapter.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/lockable_adapter.hpp (original)
+++ sandbox/synchro/boost/synchro/lockable_adapter.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -13,14 +13,14 @@
#include <boost/synchro/lockable_traits.hpp>
#include <boost/synchro/timeout_exception.hpp>
-#include <boost/noncopyable.hpp>
+#include <boost/synchro/detail/deleted_functions.hpp>
#include <boost/thread/thread_time.hpp>
namespace boost { namespace synchro {
//[exclusive_lockable_adapter
template <typename Lockable>
-class exclusive_lockable_adapter : private boost::noncopyable
+class exclusive_lockable_adapter
{
public:
typedef Lockable lockable_type;
@@ -35,6 +35,10 @@
void lock() {lock_.lock();}
void unlock() {lock_.unlock();}
bool try_lock() { return lock_.try_lock();}
+
+ BOOST_COPY_CONSTRUCTOR_DELETE(exclusive_lockable_adapter) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(exclusive_lockable_adapter) /*< disable copy asignement >*/
+
protected:
lockable_type* mutex() const { return &lock_; }
mutable Lockable lock_;
@@ -61,7 +65,7 @@
{the_lock().lock_until(abs_time);}
template<typename TimeDuration>
void lock_for(TimeDuration const & relative_time)
- {return the_lock().lock_for(relative_time);}
+ {the_lock().lock_for(relative_time);}
protected:
TimedLock& the_lock() {return *static_cast<TimedLock*>(&this->lock_);}
@@ -84,8 +88,16 @@
{return the_lock().try_lock_shared();}
void unlock_shared()
{the_lock().unlock_shared();}
+
bool try_lock_shared_until(system_time const& t)
{return the_lock().try_lock_shared_until(t);}
+ template<typename TimeDuration>
+ bool try_lock_shared_for(TimeDuration const& t)
+ {return the_lock().try_lock_shared_for(t);}
+
+ template<typename TimeDuration>
+ void lock_shared_for(TimeDuration const& t)
+ {the_lock().lock_shared_for(t);}
void lock_shared_until(system_time const& t)
{the_lock().lock_shared_until(t);}
@@ -122,10 +134,16 @@
{the_lock().unlock_and_lock_shared();}
void unlock_upgrade_and_lock_shared()
{the_lock().unlock_upgrade_and_lock_shared();}
- bool try_lock_upgrade_until(system_time const&t)
+ bool try_lock_upgrade_until(system_time const&t)
{return the_lock().try_lock_upgrade_until(t);}
+ template<typename TimeDuration>
+ bool try_lock_upgrade_for(TimeDuration const&t)
+ {return the_lock().try_lock_upgrade_for(t);}
void lock_upgrade_until(system_time const&t)
{the_lock().lock_upgrade_until(t);}
+ template<typename TimeDuration>
+ void lock_upgrade_for(TimeDuration const&t)
+ {the_lock().lock_upgrade_for(t);}
protected:
UpgradableLock& the_lock() {return *static_cast<UpgradableLock*>(&this->lock_);}
Modified: sandbox/synchro/boost/synchro/lockable_concepts.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/lockable_concepts.hpp (original)
+++ sandbox/synchro/boost/synchro/lockable_concepts.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -43,8 +43,8 @@
};
//]
/**
- * TimedLockableConcept object extends ExclusiveLockConcept
- * with the try_lock_until and try_lock_for functions
+ * TimedLockableConcept object extends LockableConcept
+ * with timed lock functions: try_lock_until and try_lock_for and the exception based lock_until and lock_for
*/
//[TimedLockableConcept
@@ -53,17 +53,45 @@
BOOST_CONCEPT_ASSERT((LockableConcept<Lockable>));
BOOST_CONCEPT_USAGE(TimedLockableConcept) {
+ l.lock_until(t);
+ l.lock_for(boost::posix_time::seconds(1));
l.try_lock_until(t);
-// l.try_lock_for(1);
+ l.try_lock_for(boost::posix_time::seconds(1));
}
Lockable& l;
system_time t;
};
//]
+bool pred();
+//[ConditionLockableConcept
+template <typename Lockable>
+struct ConditionLockableConcept {
+ BOOST_CONCEPT_ASSERT((TimedLockableConcept<Lockable>));
+ typedef typename Lockable::condition Condition;
+
+ BOOST_CONCEPT_USAGE(ConditionLockableConcept) {
+ l.lock_when(c, pred);
+ l.lock_when_until(c, pred, t);
+ l.lock_when_for(c, pred, boost::posix_time::seconds(1));
+ l.relock_on(t);
+ l.relock_on_until(c, t);
+ l.relock_on_for(c, boost::posix_time::seconds(1));
+ l.relock_when(c, pred);
+ l.relock_when_until(c, pred, t);
+ l.relock_when_for(c, pred, boost::posix_time::seconds(1));
+ c.notify_one();
+ c.notify_all();
+ }
+ Lockable& l;
+ Condition c;
+ system_time t;
+};
+
+//]
/**
- * ShareLockableConcept object extends ExclusiveTimedLockConcept
- * with the lock_shared, try_lock_shared_until, try_lock_shared
+ * ShareLockableConcept object extends TimedLockableConcept
+ * with the lock_shared, lock_shared_until, lock_shared_for, try_lock_shared_until, try_lock_shared
* and unlock_shared functions
*/
//[ShareLockableConcept
@@ -73,8 +101,11 @@
BOOST_CONCEPT_USAGE(ShareLockableConcept) {
l.lock_shared();
- l.try_lock_shared_until(t);
+ l.lock_shared_until(t);
+ l.lock_shared_for(boost::posix_time::seconds(1));
l.try_lock_shared();
+ l.try_lock_shared_until(t);
+ l.try_lock_shared_for(boost::posix_time::seconds(1));
l.unlock_shared();
}
Lockable& l;
@@ -96,8 +127,11 @@
BOOST_CONCEPT_USAGE(UpgradeLockableConcept) {
l.lock_upgrade();
+ //l.lock_upgrade_until(t);
+ //l.lock_upgrade_for(boost::posix_time::seconds(1));
l.try_lock_upgrade();
- // l.try_lock_upgrade_until(t);
+ //l.try_lock_upgrade_until(t);
+ //l.try_lock_upgrade_for(boost::posix_time::seconds(1));
l.unlock_upgrade_and_lock();
l.unlock_and_lock_upgrade();
l.unlock_and_lock_shared();
Modified: sandbox/synchro/boost/synchro/locker_concepts.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/locker_concepts.hpp (original)
+++ sandbox/synchro/boost/synchro/locker_concepts.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -12,8 +12,11 @@
#define BOOST_SYNCHRO_LOCKER_CONCEPTS_HPP
#include <boost/synchro/lockable_traits.hpp>
+#include <boost/synchro/lockers.hpp>
#include <boost/date_time/posix_time/ptime.hpp>
#include <boost/concept_check.hpp>
+#include <boost/thread/thread_time.hpp>
+
namespace boost { namespace synchro {
/**
@@ -24,15 +27,84 @@
*/
template <typename Locker>
+struct BasicLockerConcept {
+ typedef typename lockable_type<Locker>::type lockable_type;
+
+ BOOST_CONCEPT_USAGE(BasicLockerConcept) {
+ const Locker l1(mtx_);
+ if (l1.is_locking(mtx_)) return;
+ if (l1.owns_lock()) return;
+ if (l1) return;
+ if (!l1) return;
+ }
+ lockable_type mtx_;
+ system_time t;
+};
+
+template <typename Locker>
struct LockerConcept {
+ BOOST_CONCEPT_ASSERT((BasicLockerConcept<Locker>));
typedef typename lockable_type<Locker>::type lockable_type;
+
BOOST_CONCEPT_USAGE(LockerConcept) {
- Locker l(mtx_);
+ Locker l2(mtx_, defer_lock);
+ Locker l3(mtx_, adopt_lock);
+ Locker l4(mtx_, try_to_lock);
+ l2.lock();
+ if (l2.try_lock()) return;
+ l2.unlock();
+ l2.release();
+ }
+ lockable_type mtx_;
+ system_time t;
+};
+
+template <typename Locker>
+struct TimedLockerConcept {
+ BOOST_CONCEPT_ASSERT((LockerConcept<Locker>));
+ typedef typename lockable_type<Locker>::type lockable_type;
+
+ BOOST_CONCEPT_USAGE(TimedLockerConcept) {
+ const Locker l1(mtx_);
+ Locker l5(mtx_, t);
+ Locker l6(mtx_, boost::posix_time::seconds(1));
+ Locker l7(t, mtx_);
+ Locker l8(boost::posix_time::seconds(1), mtx_);
+ l5.lock_until(t);
+ l5.lock_for(boost::posix_time::seconds(1));
+ if (l5.try_lock_until(t)) return;
+ if (l5.try_lock_for(boost::posix_time::seconds(1))) return;
}
lockable_type mtx_;
+ system_time t;
};
+template <typename Locker>
+struct UniqueLockerConcept {
+ BOOST_CONCEPT_ASSERT((TimedLockerConcept<Locker>));
+
+ BOOST_CONCEPT_USAGE(UniqueLockerConcept) {
+
+ }
+};
+
+template <typename Locker>
+struct SharedLockerConcept {
+ BOOST_CONCEPT_ASSERT((TimedLockerConcept<Locker>));
+
+ BOOST_CONCEPT_USAGE(SharedLockerConcept) {
+ }
+};
+
+template <typename Locker>
+struct UpgradeLockerConcept {
+ BOOST_CONCEPT_ASSERT((TimedLockerConcept<Locker>));
+
+ BOOST_CONCEPT_USAGE(UpgradeLockerConcept) {
+ }
+};
+
/**
* MovableLockerConcept object extends LockerConcept
* with the timed_lock function
@@ -46,10 +118,9 @@
BOOST_CONCEPT_USAGE(MovableLockerConcept) {
Locker l1(mtx_);
Locker& l2(l1);
- Locker l3(l1.move());
+ Locker l3(boost::move(l1));
BOOST_ASSERT((l2.mutex()!=&mtx_));
l3.lock();
- l2 = l3.move();
}
lockable_type mtx_;
};
Modified: sandbox/synchro/boost/synchro/lockers/locking_ptr.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/lockers/locking_ptr.hpp (original)
+++ sandbox/synchro/boost/synchro/lockers/locking_ptr.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -11,7 +11,7 @@
#ifndef BOOST_SYNCHRO_LOCKING_PTR__HPP
#define BOOST_SYNCHRO_LOCKING_PTR__HPP
-#include <boost/noncopyable.hpp>
+#include <boost/synchro/detail/deleted_functions.hpp>
#include <boost/thread/mutex.hpp>
namespace boost { namespace synchro {
@@ -68,7 +68,7 @@
*/
//[locking_ptr
template <typename T, typename Lockable=boost::mutex>
-class locking_ptr : private boost::noncopyable /*< Is not copyable >*/ {
+class locking_ptr {
public:
typedef T value_type;
typedef Lockable lockable_type;
@@ -85,6 +85,11 @@
{ return *ptr_; }
value_type* operator->()
{ return ptr_; }
+
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(locking_ptr) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(locking_ptr) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(locking_ptr) /*< disable copy asignement >*/
+
private:
value_type* ptr_;
lockable_type& mtx_;
@@ -93,7 +98,7 @@
//[locking_ptr_lockable_value_type
template <typename Lockable>
-class locking_ptr_1 : private boost::noncopyable {
+class locking_ptr_1 {
public:
typedef Lockable value_type;
typedef Lockable mutex_type;
@@ -108,13 +113,18 @@
{ return *ptr_; }
value_type* operator->()
{ return ptr_; }
+
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(locking_ptr_1) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(locking_ptr_1) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(locking_ptr_1) /*< disable copy asignement >*/
+
private:
value_type* ptr_; /*< only one pointer needed >*/
};
//]
template <typename T, typename SharableLockable>
-class sharable_locking_ptr : private boost::noncopyable {
+class sharable_locking_ptr {
public:
typedef T value_type;
typedef SharableLockable mutex_type;
@@ -135,13 +145,17 @@
{ return ptr_; }
const value_type* operator->() const
{ return ptr_; }
+
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(sharable_locking_ptr) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(sharable_locking_ptr) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(sharable_locking_ptr) /*< disable copy asignement >*/
private:
value_type* ptr_;
mutex_type* mtx_;
};
template <typename T, typename SharableLockable>
-class sharable_locking_ptr<const T, SharableLockable> : private boost::noncopyable {
+class sharable_locking_ptr<const T, SharableLockable> {
public:
typedef T value_type;
typedef SharableLockable mutex_type;
@@ -162,6 +176,10 @@
{ return ptr_; }
const value_type* operator->() const
{ return ptr_; }
+
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(sharable_locking_ptr) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(sharable_locking_ptr) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(sharable_locking_ptr) /*< disable copy asignement >*/
private:
value_type* ptr_;
mutex_type* mtx_;
@@ -169,7 +187,7 @@
#if 0
template <typename T, typename MUTEX>
-class rw_locking_ptr<T, MUTEX> : private boost::noncopyable {
+class rw_locking_ptr<T, MUTEX> {
public:
typedef const T value_type;
typedef MUTEX mutex_type;
@@ -186,13 +204,18 @@
{ return *ptr_; }
value_type* operator->()
{ return ptr_; }
+
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(rw_locking_ptr) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(rw_locking_ptr) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(rw_locking_ptr) /*< disable copy asignement >*/
+
private:
value_type* ptr_;
mutex_type* mtx_;
};
template <typename T, typename MUTEX>
-class rw_locking_ptr<const T, MUTEX> : private boost::noncopyable {
+class rw_locking_ptr<const T, MUTEX> {
public:
typedef T value_type;
typedef MUTEX mutex_type;
@@ -209,13 +232,17 @@
{ return *ptr_; }
const value_type* operator->()
{ return ptr_; }
+
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(rw_locking_ptr) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(rw_locking_ptr) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(rw_locking_ptr) /*< disable copy asignement >*/
private:
value_type* ptr_;
mutex_type* mtx_;
};
template <typename LOCKABLE>
-class locking_ptr<LOCKABLE, LOCKABLE> : private boost::noncopyable {
+class locking_ptr<LOCKABLE, LOCKABLE> {
public:
typedef LOCKABLE value_type;
typedef LOCKABLE mutex_type;
@@ -231,12 +258,16 @@
{ return *ptr_; }
value_type* operator->()
{ return ptr_; }
+
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(locking_ptr) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(locking_ptr) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(locking_ptr) /*< disable copy asignement >*/
private:
value_type* ptr_;
};
template <typename T, typename MUTEX>
-class read_locking_ptr : private boost::noncopyable {
+class read_locking_ptr {
public:
typedef T value_type;
typedef MUTEX mutex_type;
@@ -253,6 +284,10 @@
{ return *ptr_; }
const value_type* operator->() const
{ return ptr_; }
+
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(read_locking_ptr) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(read_locking_ptr) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(read_locking_ptr) /*< disable copy asignement >*/
private:
const value_type* ptr_;
mutex_type* mtx_;
Modified: sandbox/synchro/boost/synchro/lockers/nested_reverse_locker.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/lockers/nested_reverse_locker.hpp (original)
+++ sandbox/synchro/boost/synchro/lockers/nested_reverse_locker.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -12,10 +12,10 @@
#define BOOST_SYNCHRO_NESTED_REVERSE_LOCKER__HPP
#include <boost/mpl/bool.hpp>
-#include <boost/noncopyable.hpp>
#include <boost/concept_check.hpp>
#include <boost/synchro/lockable_traits.hpp>
#include <boost/synchro/locker_concepts.hpp>
+#include <boost/synchro/detail/deleted_functions.hpp>
namespace boost { namespace synchro {
@@ -31,8 +31,7 @@
*/
template <typename Locker>
-class nested_reverse_locker : boost::noncopyable
-{
+class nested_reverse_locker {
// BOOST_CONCEPT_ASSERT((MovableLockConcept<Locker>));
typedef typename lock_error_type<typename lockable_type<Locker>::type >::type lock_error;
@@ -60,11 +59,14 @@
locker_=tmp_locker_.move(); /*< Move ownership to nesting locker >*/
}
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(nested_reverse_locker) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(nested_reverse_locker) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(nested_reverse_locker) /*< disable copy asignement >*/
+
protected:
Locker& locker_;
Locker tmp_locker_;
bool was_locked_;
- nested_reverse_locker();
};
}
Modified: sandbox/synchro/boost/synchro/lockers/on_dereference_locking_ptr.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/lockers/on_dereference_locking_ptr.hpp (original)
+++ sandbox/synchro/boost/synchro/lockers/on_dereference_locking_ptr.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -11,12 +11,14 @@
#ifndef BOOST_SYNCHRO_ON_DEREFERENCE_LOCKING_PTR__HPP
#define BOOST_SYNCHRO_ON_DEREFERENCE_LOCKING_PTR__HPP
-#include <boost/noncopyable.hpp>
+#include <boost/synchro/detail/deleted_functions.hpp>
namespace boost { namespace synchro {
+template<typename T, typename Lockable=T>
+class on_dereference_locking_ptr;
template<typename T, typename Lockable>
-class on_dereference_locking_ptr : private boost::noncopyable
+class on_dereference_locking_ptr
{
public:
class pointer
@@ -51,6 +53,9 @@
{
return pointer(target_, mutex_);
}
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(on_dereference_locking_ptr) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(on_dereference_locking_ptr) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(on_dereference_locking_ptr) /*< disable copy asignement >*/
private:
T* target_;
Lockable* mutex_;
@@ -92,6 +97,9 @@
{
return pointer(target);
}
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(on_dereference_locking_ptr) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(on_dereference_locking_ptr) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(on_dereference_locking_ptr) /*< disable copy asignement >*/
private:
Lockable *target;
};
Modified: sandbox/synchro/boost/synchro/lockers/reverse_locker.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/lockers/reverse_locker.hpp (original)
+++ sandbox/synchro/boost/synchro/lockers/reverse_locker.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -12,7 +12,7 @@
#define BOOST_SYNCHRO_REVERSE_LOCKER__HPP
#include <boost/mpl/bool.hpp>
-#include <boost/noncopyable.hpp>
+#include <boost/synchro/detail/deleted_functions.hpp>
#include <boost/concept_check.hpp>
#include <boost/synchro/lockable_traits.hpp>
#include <boost/synchro/locker_concepts.hpp>
@@ -37,6 +37,9 @@
{
reverse_locker(Lockable& mtx): mtx_(mtx) {mtx_.unlock();}
~reverse_locker() {mtx_.lock();}
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(reverse_locker) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(reverse_locker) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(reverse_locker) /*< disable copy asignement >*/
protected:
Lockable& mtx_;
Modified: sandbox/synchro/boost/synchro/lockers/strict_locker.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/lockers/strict_locker.hpp (original)
+++ sandbox/synchro/boost/synchro/lockers/strict_locker.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -40,17 +40,13 @@
template <typename Locker>
struct StrictLockerConcept {
- typedef typename lockable_type<Locker>::type lockable_type;
+ BOOST_CONCEPT_ASSERT((BasicLockerConcept<Locker>));
BOOST_STATIC_ASSERT((is_strict_locker<Locker>::value));
+ typedef typename lockable_type<Locker>::type lockable_type;
- void f(Locker& l ) {
- BOOST_ASSERT((l.is_locking(lock)));
- }
BOOST_CONCEPT_USAGE(StrictLockerConcept) {
{
-// Locker l(lock);
-// BOOST_ASSERT((l));
}
}
lockable_type lock;
@@ -58,12 +54,9 @@
#if 0
//[strict_locker_synopsis
template <typename Lockable>
-class strict_locker
- : private boost::noncopyable
-{
+class strict_locker {
public:
typedef Lockable lockable_type;
- typedef typename lock_traits<lockable_type>::lock_error bad_lock;
typedef unspecified bool_type;
explicit strict_locker(lockable_type& obj);
@@ -74,23 +67,17 @@
bool owns_lock() const;
bool is_locking(lockable_type* l) const; /*< strict locker specific function >*/
- BOOST_ADRESS_OF_DELETE(strict_locker)
- BOOST_HEAP_ALLOCATION_DELETE()
+ BOOST_ADRESS_OF_DELETE(strict_locker) /*< disable aliasing >*/
+ BOOST_HEAP_ALLOCATION_DELETE() /*< disable heap allocation >*/
BOOST_DEFAULT_CONSTRUCTOR_DELETE(strict_locker) /*< disable default construction >*/
BOOST_COPY_CONSTRUCTOR_DELETE(strict_locker) /*< disable copy construction >*/
BOOST_COPY_ASSIGNEMENT_DELETE(strict_locker) /*< disable copy asignement >*/
-
-private:
- strict_locker();
};
//]
#endif
//[strict_locker
template <typename Lockable>
class strict_locker
-#if 0
- : private boost::noncopyable /*< Is not copyable >*/
-#endif
{
BOOST_CONCEPT_ASSERT((LockableConcept<Lockable>));
@@ -107,28 +94,17 @@
const lockable_type* mutex() const { return &obj_; }
bool is_locking(lockable_type* l) const { return l==mutex(); } /*< strict lockers specific function >*/
- /*< no possibility to unlock >*/
-
-#if 0
-private: \
- strict_locker* operator&(); \
-public:
-#else
BOOST_ADRESS_OF_DELETE(strict_locker) /*< disable aliasing >*/
BOOST_HEAP_ALLOCATEION_DELETE(strict_locker) /*< disable heap allocation >*/
BOOST_DEFAULT_CONSTRUCTOR_DELETE(strict_locker) /*< disable default construction >*/
BOOST_COPY_CONSTRUCTOR_DELETE(strict_locker) /*< disable copy construction >*/
BOOST_COPY_ASSIGNEMENT_DELETE(strict_locker) /*< disable copy asignement >*/
-#endif
+
+ /*< no possibility to unlock >*/
private:
lockable_type& obj_;
-#if 0
- strict_locker(); /*< disable default constructor >*/
-#endif
-
-
};
//]
template <typename Lockable>
@@ -142,9 +118,6 @@
//[nested_strict_locker
template <typename Locker >
class nested_strict_locker
-#if 0
- : private boost::noncopyable
-#endif
{
BOOST_CONCEPT_ASSERT((MovableLockerConcept<Locker>));
public:
@@ -155,12 +128,12 @@
: locker_(locker) /*< Store reference to locker >*/
, tmp_locker_(locker.move()) /*< Move ownership to temporaty locker >*/
{
-#ifndef BOOST_SYNCHRO_STRCIT_LOCKER_DONT_CHECK_OWNERSHIP /*< Define BOOST_SYNCHRO_EXTERNALLY_LOCKED_DONT_CHECK_OWNERSHIP if you don't want to check locker ownership >*/
+ #ifndef BOOST_SYNCHRO_STRCIT_LOCKER_DONT_CHECK_OWNERSHIP /*< Define BOOST_SYNCHRO_EXTERNALLY_LOCKED_DONT_CHECK_OWNERSHIP if you don't want to check locker ownership >*/
if (tmp_locker_.mutex()==0) {
locker_=tmp_locker_.move(); /*< Rollback for coherency purposes >*/
throw lock_error();
}
-#endif
+ #endif
if (!tmp_locker_) tmp_locker_.lock(); /*< ensures it is locked >*/
}
~nested_strict_locker() {
@@ -173,23 +146,15 @@
const lockable_type* mutex() const { return tmp_locker_.mutex(); }
bool is_locking(lockable_type* l) const { return l==mutex(); }
-#if 1
-private: \
- nested_strict_locker* operator&(); \
-public:
-#else
BOOST_ADRESS_OF_DELETE(nested_strict_locker)
BOOST_HEAP_ALLOCATEION_DELETE(nested_strict_locker)
- BOOST_DEFAULT_CONSTRUCTOR_DELETE(strict_locker) /*< disable default construction >*/
- BOOST_COPY_CONSTRUCTOR_DELETE(strict_locker) /*< disable copy construction >*/
- BOOST_COPY_ASSIGNEMENT_DELETE(strict_locker) /*< disable copy asignement >*/
-#endif
+ BOOST_DEFAULT_CONSTRUCTOR_DELETE(nested_strict_locker) /*< disable default construction >*/
+ BOOST_COPY_CONSTRUCTOR_DELETE(nested_strict_locker) /*< disable copy construction >*/
+ BOOST_COPY_ASSIGNEMENT_DELETE(nested_strict_locker) /*< disable copy asignement >*/
+
private:
Locker& locker_;
Locker tmp_locker_;
-#if 0
- nested_strict_locker();
-#endif
};
//]
Modified: sandbox/synchro/boost/synchro/null_mutex.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/null_mutex.hpp (original)
+++ sandbox/synchro/boost/synchro/null_mutex.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -64,12 +64,23 @@
bool try_lock_until(const boost::posix_time::ptime &)
{ return true; }
-// bool timed_lock(system_time const & abs_time)
-// {return true;}
+ //!Simulates a mutex try_lock_for() operation.
+ //!Equivalent to "return true;"
template<typename TimeDuration>
bool try_lock_for(TimeDuration const & relative_time)
{return true;}
+ //!Simulates a mutex timed_lock() operation.
+ //!Equivalent to "return true;"
+ bool lock_until(const boost::posix_time::ptime &)
+ { return true; }
+
+ //!Simulates a mutex lock_for() operation.
+ //!Equivalent to "return true;"
+ template<typename TimeDuration>
+ bool lock_for(TimeDuration const & relative_time)
+ {return true;}
+
//!Simulates a mutex unlock() operation.
//!Empty function.
@@ -84,11 +95,28 @@
bool try_lock_shared()
{ return true; }
- //!Simulates a mutex timed_lock_share() operation.
+ //!Simulates a mutex try_lock_shared_until() operation.
//!Equivalent to "return true;"
bool try_lock_shared_until(const boost::posix_time::ptime &)
{ return true; }
+ //!Simulates a mutex try_lock_shared_for() operation.
+ //!Equivalent to "return true;"
+ template<typename TimeDuration>
+ bool try_lock_shared_for(const TimeDuration &)
+ { return true; }
+
+ //!Simulates a mutex lock_shared_until() operation.
+ //!Equivalent to "return true;"
+ bool lock_shared_until(const boost::posix_time::ptime &)
+ { return true; }
+
+ //!Simulates a mutex lock_shared_for() operation.
+ //!Equivalent to "return true;"
+ template<typename TimeDuration>
+ bool lock_shared_for(const TimeDuration &)
+ { return true; }
+
//!Simulates a mutex unlock_share() operation.
//!Empty function.
void unlock_shared(){}
@@ -102,7 +130,7 @@
bool try_lock_upgrade()
{ return true; }
- //!Simulates a mutex timed_lock_upgrade() operation.
+ //!Simulates a mutex try_lock_upgrade_until() operation.
//!Equivalent to "return true;"
bool try_lock_upgrade_until(boost::posix_time::ptime const &)
{ return true; }
@@ -134,7 +162,7 @@
bool try_unlock_upgrade_and_lock()
{ return true; }
- //!Simulates timed_unlock_upgrade_and_lock().
+ //!Simulates unlock_upgrade_and_lock_until().
//!Equivalent to "return true;"
bool unlock_upgrade_and_lock_until(const boost::posix_time::ptime &)
{ return true; }
Modified: sandbox/synchro/boost/synchro/poly/lock.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/poly/lock.hpp (original)
+++ sandbox/synchro/boost/synchro/poly/lock.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -32,6 +32,12 @@
{
return try_lock_until(get_system_time()+abs_time);
}
+ bool lock_until(boost::system_time const& abs_time)=0;
+ template<typename DurationType>
+ bool lock_for(DurationType const& rel_time)
+ {
+ return lock_until(get_system_time()+abs_time);
+ }
};
@@ -42,12 +48,18 @@
virtual void lock_shared()=0;
virtual bool try_lock_shared()=0;
virtual bool try_lock_shared_until(boost::system_time const& abs_time)=0;
- virtual void unlock_shared()=0;
template<typename DurationType>
bool try_lock_shared_for(DurationType const& rel_time)
{
return try_lock_shared_until(get_system_time()+abs_time);
}
+ virtual bool lock_shared_until(boost::system_time const& abs_time)=0;
+ template<typename DurationType>
+ bool lock_shared_for(DurationType const& rel_time)
+ {
+ return lock_shared_until(get_system_time()+abs_time);
+ }
+ virtual void unlock_shared()=0;
};
//////////////////////////////////////////////////////////////////////////////
@@ -55,6 +67,21 @@
struct upgradable_lock : sharable_lock {
virtual ~upgradable_lock();
virtual void lock_upgrade()=0;
+
+ virtual bool try_lock_upgrade_until(system_time const&t)=0;
+ template<typename TimeDuration>
+ bool try_lock_upgrade_for(TimeDuration const&t)
+ {
+ return try_lock_upgrade_for(t);
+ }
+
+ virtual void lock_upgrade_until(system_time const&t)=0;
+ template<typename TimeDuration>
+ virtual void lock_upgrade_for(TimeDuration const&t)
+ {
+ lock_upgrade_for(t);
+ }
+
virtual void unlock_upgrade()=0;
virtual void unlock_upgrade_and_lock()=0;
virtual void unlock_and_lock_upgrade()=0;
Modified: sandbox/synchro/boost/synchro/poly/lock_adapter.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/poly/lock_adapter.hpp (original)
+++ sandbox/synchro/boost/synchro/poly/lock_adapter.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -18,16 +18,24 @@
template <typename Lockable>
class exclusive_lock_adapter
- : public virtual exclusive_lock
+ : public exclusive_lock
{
+ typedef Lockable lockable_type;
+ typedef typename scope_tag<Lockable>::type scope;
+ typedef typename category_tag<Lockable>::type category;
+ typedef typename reentrancy_tag<Lockable>::type reentrancy;
+ typedef typename timed_interface_tag<Lockable>::type timed_interface;
+ typedef typename lifetime_tag<Lockable>::type lifetime;
+ typedef typename naming_tag<Lockable>::type naming;
+
exclusive_lock_adapter(): lock_() {}
- virtual ~exclusive_lock_adapter() {}
+ ~exclusive_lock_adapter() {}
- virtual void lock()
+ void lock()
{lock_.lock();}
- virtual void unlock()
+ void unlock()
{lock_.unlock();}
- virtual bool try_lock()
+ bool try_lock()
{ return lock_.try_lock();}
protected:
Lockable lock_;
@@ -36,15 +44,20 @@
template <typename TimeLockable>
class timed_lock_adapter
: public exclusive_lock_adapter<TimeLockable>
- , public virtual timed_lock
+ , public timed_lock
{
public:
- virtual ~timed_lock_adapter() {}
+ ~timed_lock_adapter() {}
bool try_lock_until(boost::system_time const& abs_time)
{return the_lock().try_lock_until(abs_time);}
template<typename DurationType>
bool try_lock_for(DurationType const& rel_time)
{return try_lock_for(rel_time);}
+ bool lock_until(boost::system_time const& abs_time)
+ {return the_lock().lock_until(abs_time);}
+ template<typename DurationType>
+ bool lock_for(DurationType const& rel_time)
+ {return lock_for(rel_time);}
private:
TimeLockable& the_lock() {return *static_cast<SharableLock*>(&this->lock_);}
};
@@ -55,17 +68,30 @@
template <typename SharableLock>
class sharable_lock_adapter
: public timed_lock_adapter<SharableLock>
- , public virtual sharable_lock
+ , public sharable_lock
{
public:
- virtual ~sharable_lock_adapter()
+ ~sharable_lock_adapter()
{}
- virtual void lock_shared()
+ void lock_shared()
{the_lock().lock_shared();}
- virtual bool try_lock_shared()
+ bool try_lock_shared()
{return the_lock().try_lock_shared();}
- virtual void unlock_shared()
+ void unlock_shared()
{the_lock().unlock_shared();}
+
+ bool try_lock_shared_until(system_time const& t)
+ {return the_lock().try_lock_shared_until(t);}
+ template<typename TimeDuration>
+ bool try_lock_shared_for(TimeDuration const& t)
+ {return the_lock().try_lock_shared_for(t);}
+
+ template<typename TimeDuration>
+ void lock_shared_for(TimeDuration const& t)
+ {the_lock().lock_shared_for(t);}
+ void lock_shared_until(system_time const& t)
+ {the_lock().lock_shared_until(t);}
+
private:
SharableLock& the_lock() {return *static_cast<SharableLock*>(&this->lock_);}
};
@@ -75,24 +101,35 @@
template <typename UpgradableLock>
class upgradable_lock_adapter
: public sharable_lock_adapter<UpgradableLock>
- , public virtual upgradable_lock
+ , public upgradable_lock
{
public:
- virtual ~upgradable_lock_adapter() {}
- virtual void lock_upgrade()
+ ~upgradable_lock_adapter() {}
+ void lock_upgrade()
{the_lock().lock_upgrade();}
-
- virtual void unlock_upgrade()
+ void unlock_upgrade()
{the_lock().unlock_upgrade();}
- virtual void unlock_upgrade_and_lock()
+ void unlock_upgrade_and_lock()
{the_lock().unlock_upgrade_and_lock();}
- virtual void unlock_and_lock_upgrade()
+ void unlock_and_lock_upgrade()
{the_lock().unlock_and_lock_upgrade();}
- virtual void unlock_and_lock_shared()
+ void unlock_and_lock_shared()
{the_lock().unlock_and_lock_shared();}
- virtual void unlock_upgrade_and_lock_shared()
+ void unlock_upgrade_and_lock_shared()
{the_lock().unlock_upgrade_and_lock_shared();}
+
+ bool try_lock_upgrade_until(system_time const&t)
+ {return the_lock().try_lock_upgrade_until(t);}
+ template<typename TimeDuration>
+ bool try_lock_upgrade_for(TimeDuration const&t)
+ {return the_lock().try_lock_upgrade_for(t);}
+ void lock_upgrade_until(system_time const&t)
+ {the_lock().lock_upgrade_until(t);}
+ template<typename TimeDuration>
+ void lock_upgrade_for(TimeDuration const&t)
+ {the_lock().lock_upgrade_for(t);}
+
private:
UpgradableLock& the_lock() {return *static_cast<UpgradableLock*>(&this->lock_);}
};
Modified: sandbox/synchro/boost/synchro/process/mutex.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/process/mutex.hpp (original)
+++ sandbox/synchro/boost/synchro/process/mutex.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -44,13 +44,13 @@
{return timed_lock(abs_time);}
template<typename TimeDuration>
bool try_lock_for(TimeDuration const & relative_time)
- {return timed_lock(relative_time);}
+ {return timed_lock(boost::get_system_time()+relative_time);}
void lock_until(system_time const & abs_time)
{if(!timed_lock(abs_time)) throw timeout_exception();}
template<typename TimeDuration>
void lock_for(TimeDuration const & relative_time)
- {if(!timed_lock(relative_time)) throw timeout_exception();}
+ {if(!timed_lock(boost::get_system_time()+relative_time)) throw timeout_exception();}
//bool try_lock_shared_until(system_time const& abs_time)
//{return timed_lock_shared(abs_time);}
Modified: sandbox/synchro/boost/synchro/process/named_mutex.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/process/named_mutex.hpp (original)
+++ sandbox/synchro/boost/synchro/process/named_mutex.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -50,13 +50,13 @@
{return this->timed_lock(abs_time);}
template<typename TimeDuration>
bool try_lock_for(TimeDuration const & relative_time)
- {return timed_lock(relative_time);}
+ {return timed_lock(boost::get_system_time()+relative_time);}
void lock_until(system_time const & abs_time)
{if(!timed_lock(abs_time)) throw timeout_exception();}
template<typename TimeDuration>
void lock_for(TimeDuration const & relative_time)
- {if(!timed_lock(relative_time)) throw timeout_exception();}
+ {if(!timed_lock(boost::get_system_time()+relative_time)) throw timeout_exception();}
};
#if 0
typedef boost::interprocess::named_mutex named_mutex;
Modified: sandbox/synchro/boost/synchro/process/named_upgradable_mutex.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/process/named_upgradable_mutex.hpp (original)
+++ sandbox/synchro/boost/synchro/process/named_upgradable_mutex.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -48,13 +48,13 @@
{return timed_lock(abs_time);}
template<typename TimeDuration>
bool try_lock_for(TimeDuration const & relative_time)
- {return timed_lock(relative_time);}
+ {return timed_lock(boost::get_system_time()+relative_time);}
void lock_until(system_time const & abs_time)
{if(!timed_lock(abs_time)) throw timeout_exception();}
template<typename TimeDuration>
void lock_for(TimeDuration const & relative_time)
- {if(!timed_lock(relative_time)) throw timeout_exception();}
+ {if(!timed_lock(boost::get_system_time()+relative_time)) throw timeout_exception();}
void lock_shared()
{lock_sharable();}
@@ -64,8 +64,15 @@
bool try_lock_shared_until(const boost::posix_time::ptime &abs_time)
{return timed_lock_sharable(abs_time);}
+ template<typename TimeDuration>
+ bool try_lock_shared_for(const TimeDuration &rel_time)
+ {return timed_lock_sharable(boost::get_system_time()+rel_time);}
+
void lock_shared_until(const boost::posix_time::ptime &abs_time)
{if(!timed_lock_sharable(abs_time)) throw timeout_exception();}
+ template<typename TimeDuration>
+ void lock_shared_for(const TimeDuration &rel_time)
+ {if(!timed_lock_sharable(boost::get_system_time()+rel_time)) throw timeout_exception();}
void unlock_shared()
{unlock_sharable();}
@@ -78,9 +85,16 @@
bool try_lock_upgrade_until(const boost::posix_time::ptime &abs_time)
{return timed_lock_upgradable(abs_time);}
+ template<typename TimeDuration>
+ bool try_lock_upgrade_for(const TimeDuration &rel_time)
+ {return timed_lock_upgradable(boost::get_system_time()+rel_time);}
+
void lock_upgrade_until(const boost::posix_time::ptime &abs_time)
{if(!timed_lock_upgradable(abs_time)) throw timeout_exception();}
-
+ template<typename TimeDuration>
+ bool lock_upgrade_for(const TimeDuration &rel_time)
+ {if(!timed_lock_upgradable(boost::get_system_time()+rel_time)) throw timeout_exception();}
+
void unlock_upgrade()
{unlock_upgradable();}
Modified: sandbox/synchro/boost/synchro/process/recursive_mutex.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/process/recursive_mutex.hpp (original)
+++ sandbox/synchro/boost/synchro/process/recursive_mutex.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -45,13 +45,13 @@
{return this->timed_lock(abs_time);}
template<typename TimeDuration>
bool try_lock_for(TimeDuration const & relative_time)
- {return timed_lock(relative_time);}
+ {return timed_lock(boost::get_system_time()+relative_time);}
void lock_until(system_time const & abs_time)
{if(!timed_lock(abs_time)) throw timeout_exception();}
template<typename TimeDuration>
void lock_for(TimeDuration const & relative_time)
- {if(!timed_lock(relative_time)) throw timeout_exception();}
+ {if(!timed_lock(boost::get_system_time()+relative_time)) throw timeout_exception();}
//bool try_lock_shared_until(system_time const& abs_time)
//{return timed_lock_shared(abs_time);}
Modified: sandbox/synchro/boost/synchro/process/upgradable_mutex.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/process/upgradable_mutex.hpp (original)
+++ sandbox/synchro/boost/synchro/process/upgradable_mutex.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -43,13 +43,13 @@
{return timed_lock(abs_time);}
template<typename TimeDuration>
bool try_lock_for(TimeDuration const & relative_time)
- {return timed_lock(relative_time);}
+ {return timed_lock(boost::get_system_time()+relative_time);}
- void try_lock_until(throw_timeout_t&, system_time const & abs_time)
+ void lock_until(system_time const & abs_time)
{if(!timed_lock(abs_time)) throw timeout_exception();}
template<typename TimeDuration>
- void try_lock_for(throw_timeout_t&, TimeDuration const & relative_time)
- {if(!timed_lock(relative_time)) throw timeout_exception();}
+ void lock_for(TimeDuration const & relative_time)
+ {if(!timed_lock(boost::get_system_time()+relative_time)) throw timeout_exception();}
void lock_shared()
{lock_sharable();}
@@ -59,8 +59,15 @@
bool try_lock_shared_until(const boost::posix_time::ptime &abs_time)
{return timed_lock_sharable(abs_time);}
- void try_lock_shared_until(throw_timeout_t&, const boost::posix_time::ptime &abs_time)
+ template<typename TimeDuration>
+ bool try_lock_shared_for(const TimeDuration &rel_time)
+ {return timed_lock_sharable(boost::get_system_time()+rel_time);}
+
+ void lock_shared_until(const boost::posix_time::ptime &abs_time)
{if(!timed_lock_sharable(abs_time)) throw timeout_exception();}
+ template<typename TimeDuration>
+ void lock_shared_for(const TimeDuration &rel_time)
+ {if(!timed_lock_sharable(boost::get_system_time()+rel_time)) throw timeout_exception();}
void unlock_shared()
{unlock_sharable();}
@@ -73,8 +80,16 @@
bool try_lock_upgrade_until(const boost::posix_time::ptime &abs_time)
{return timed_lock_upgradable(abs_time);}
- void tru_lock_upgrade_until(throw_timeout_t&, const boost::posix_time::ptime &abs_time)
+ template<typename TimeDuration>
+ bool try_lock_upgrade_for(const TimeDuration &rel_time)
+ {return timed_lock_upgradable(rel_time);}
+
+
+ void lock_upgrade_until(const boost::posix_time::ptime &abs_time)
{if(!timed_lock_upgradable(abs_time)) throw timeout_exception();}
+ template<typename TimeDuration>
+ bool lock_upgrade_for(const TimeDuration &rel_time)
+ {if(!timed_lock_upgradable(rel_time)) throw timeout_exception();}
void unlock_upgrade()
{unlock_upgradable();}
Modified: sandbox/synchro/boost/synchro/thread/shared_mutex.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/thread/shared_mutex.hpp (original)
+++ sandbox/synchro/boost/synchro/thread/shared_mutex.hpp 2009-02-15 11:02:22 EST (Sun, 15 Feb 2009)
@@ -55,9 +55,15 @@
bool try_lock_shared_until(system_time const& abs_time)
{return timed_lock_shared(abs_time);}
+ template<typename TimeDuration>
+ bool try_lock_shared_for(TimeDuration const& rel_time)
+ {return timed_lock_shared(rel_time);}
void lock_shared_until(system_time const& abs_time)
{if(!timed_lock_shared(abs_time)) throw timeout_exception();}
+ template<typename TimeDuration>
+ void lock_shared_for(TimeDuration const& abs_time)
+ {if(!timed_lock_shared(abs_time)) throw timeout_exception();}
};
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