Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51809 - in sandbox/synchro: boost/convert_to boost/synchro boost/synchro/detail boost/synchro/lockable boost/synchro/lockables boost/synchro/lockables/detail boost/synchro/lockers boost/synchro/poly boost/synchro/process boost/synchro/thread libs/synchro/test
From: vicente.botet_at_[hidden]
Date: 2009-03-16 18:33:21


Author: viboes
Date: 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
New Revision: 51809
URL: http://svn.boost.org/trac/boost/changeset/51809

Log:
0.4.3 : Adding lock_until/for try_lock_until/for free functions + usage of Boost/Chrono

Added:
   sandbox/synchro/boost/convert_to/
   sandbox/synchro/boost/convert_to/chrono_duration_to_posix_time_duration.hpp (contents, props changed)
   sandbox/synchro/boost/convert_to/chrono_time_point_to_posix_time_ptime.hpp (contents, props changed)
   sandbox/synchro/boost/convert_to/convert_to.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/
   sandbox/synchro/boost/synchro/lockable/functions.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_shared.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_shared_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_shared_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_upgrade.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_upgrade_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_upgrade_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_lock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_lock_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_lock_shared.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_lock_shared_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_lock_shared_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_lock_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_lock_upgrade.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_lock_upgrade_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_lock_upgrade_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_unlock_shared_and_lock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_unlock_shared_and_lock_upgrade.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_unlock_upgrade_and_lock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_unlock_upgrade_and_lock_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/try_unlock_upgrade_and_lock_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock_and_lock_shared.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock_and_lock_upgrade.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock_shared.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock_shared_and_lock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock_upgrade.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock_shared.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/
   sandbox/synchro/boost/synchro/lockables/detail/
   sandbox/synchro/boost/synchro/lockables/detail/is_mutex_type.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/detail/lock_until_internal.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/detail/range_lock_guard.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/detail/try_lock_internal.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/detail/try_lock_until_internal.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/functions.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/lock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/lock_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/lock_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/try_lock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/try_lock_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/try_lock_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/try_lock_until3.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockables/unlock.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockers/array_locker.hpp (contents, props changed)
Text files modified:
   sandbox/synchro/boost/synchro/detail/defaulted_functions.hpp | 40 ++++++++++---
   sandbox/synchro/boost/synchro/lockable_adapter.hpp | 46 +++++++++++++++
   sandbox/synchro/boost/synchro/lockable_concepts.hpp | 63 +++++++++++----------
   sandbox/synchro/boost/synchro/null_mutex.hpp | 47 ++++++++++++++++
   sandbox/synchro/boost/synchro/poly/lock.hpp | 18 +++++
   sandbox/synchro/boost/synchro/poly/lock_adapter.hpp | 45 +++++++++++++++
   sandbox/synchro/boost/synchro/process/mutex.hpp | 38 ++++++++++++
   sandbox/synchro/boost/synchro/semaphore.hpp | 6 +
   sandbox/synchro/boost/synchro/thread/locks.hpp | 105 +++++++++++++++++++++++++++++++++--
   sandbox/synchro/boost/synchro/thread/mutex.hpp | 66 +++++++++++++++++++++-
   sandbox/synchro/boost/synchro/thread/recursive_mutex.hpp | 67 +++++++++++++++++++++-
   sandbox/synchro/boost/synchro/thread/shared_mutex.hpp | 116 +++++++++++++++++++++++++++++++++++++++
   sandbox/synchro/libs/synchro/test/Jamfile.v2 | 38 +++++++-----
   sandbox/synchro/libs/synchro/test/lockable_concepts_test.cpp | 20 ++++--
   14 files changed, 629 insertions(+), 86 deletions(-)

Added: sandbox/synchro/boost/convert_to/chrono_duration_to_posix_time_duration.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/convert_to/chrono_duration_to_posix_time_duration.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,59 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2009. 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONVERT_TO_CHRONO_DURATION_TO_POSIX_TIME_DURATION__HPP
+#define BOOST_CONVERT_TO_CHRONO_DURATION_TO_POSIX_TIME_DURATION__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/convert_to/convert_to.hpp>
+
+namespace boost {
+
+ namespace partial_specialization_workaround {
+ template < class Rep, class Period>
+ struct convert_to<posix_time::time_duration, chrono::duration<Rep, Period> > {
+ inline static posix_time::time_duration apply(chrono::duration<Rep, Period> const & from)
+ {
+ typedef chrono::duration<Rep, Period> src_duration_t;
+ typedef chrono::nanoseconds duration_t;
+ typedef duration_t::rep rep_t;
+ rep_t d = chrono::duration_cast<duration_t>(from).count();
+ rep_t sec = d/1000000000;
+ rep_t nsec = d%1000000000;
+ return boost::posix_time::seconds(static_cast<long>(sec))+
+#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
+ boost::posix_time::nanoseconds(nsec);
+#else
+ boost::posix_time::microseconds((nsec+500)/1000);
+#endif
+ }
+ inline static void apply(const chrono::duration<Rep, Period>& from, posix_time::time_duration& to)
+ {
+ to = apply(from);
+ }
+ };
+
+ template < class Rep, class Period>
+ struct convert_to<chrono::duration<Rep, Period>, posix_time::time_duration> {
+ inline static chrono::duration<Rep, Period> apply(posix_time::time_duration const & from)
+ {
+ return chrono::nanoseconds(from.total_nanoseconds());
+ }
+ inline static void apply(const posix_time::time_duration& from, chrono::duration<Rep, Period> & to)
+ {
+ to = apply(from);
+ }
+ };
+ }
+}
+
+#endif
+

Added: sandbox/synchro/boost/convert_to/chrono_time_point_to_posix_time_ptime.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/convert_to/chrono_time_point_to_posix_time_ptime.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,64 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2009. 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONVERT_TO_CHRONO_TIME_POINT_TO_POSIX_TIME_PTIME__HPP
+#define BOOST_CONVERT_TO_CHRONO_TIME_POINT_TO_POSIX_TIME_PTIME__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/convert_to/convert_to.hpp>
+
+namespace boost {
+
+ namespace partial_specialization_workaround {
+ template < class Clock, class Duration>
+ struct convert_to<posix_time::ptime, chrono::time_point<Clock, Duration> > {
+ inline static posix_time::ptime apply(const chrono::time_point<Clock, Duration>& from)
+ {
+ typedef chrono::time_point<Clock, Duration> time_point_t;
+ typedef chrono::nanoseconds duration_t;
+ typedef duration_t::rep rep_t;
+ rep_t d = chrono::duration_cast<duration_t>(from.time_since_epoch()).count();
+ rep_t sec = d/1000000000;
+ rep_t nsec = d%1000000000;
+ return boost::posix_time::from_time_t(0)+
+ boost::posix_time::seconds(static_cast<long>(sec))+
+#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
+ boost::posix_time::nanoseconds(nsec);
+#else
+ boost::posix_time::microseconds((nsec+500)/1000);
+#endif
+ }
+ inline static void apply(const chrono::time_point<Clock, Duration>& from, posix_time::ptime& to)
+ {
+ to = apply(from);
+ }
+ };
+
+ template < class Clock, class Duration>
+ struct convert_to<chrono::time_point<Clock, Duration>, posix_time::ptime> {
+ inline static chrono::time_point<Clock, Duration> apply(const posix_time::ptime& from)
+ {
+ boost::posix_time::time_duration const time_since_epoch=from-boost::posix_time::from_time_t(0);
+ chrono::time_point<Clock, Duration> t=chrono::system_clock::from_time_t(time_since_epoch.total_seconds());
+ long nsec=time_since_epoch.fractional_seconds()*(1000000000/time_since_epoch.ticks_per_second());
+ return t+chrono::nanoseconds(nsec);
+
+ }
+ inline static void apply(const posix_time::ptime& from, chrono::time_point<Clock, Duration>& to)
+ {
+ to = apply(from);
+ }
+ };
+ }
+}
+
+#endif
+

Added: sandbox/synchro/boost/convert_to/convert_to.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/convert_to/convert_to.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,44 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2009. 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONVERT_TO__HPP
+#define BOOST_CONVERT_TO__HPP
+
+namespace boost {
+
+ namespace partial_specialization_workaround {
+ template < typename To, typename From >
+ struct convert_to {
+ inline static To apply(const From& val)
+ {
+ return To(val);
+ }
+ inline static void apply(const From& from, To& to)
+ {
+ to = from;
+ }
+ };
+ }
+
+ template < typename To, typename From >
+ To convert_to(const From& val) {
+ return partial_specialization_workaround::convert_to<To,From>::apply(val);
+ }
+
+ template < typename To, typename From >
+ void convert_to(const From& from, To& to) {
+ partial_specialization_workaround::convert_to<To,From>::apply(from, to);
+ }
+
+
+}
+
+#endif
+

Modified: sandbox/synchro/boost/synchro/detail/defaulted_functions.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/detail/defaulted_functions.hpp (original)
+++ sandbox/synchro/boost/synchro/detail/defaulted_functions.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -17,22 +17,42 @@
 
 #if defined(BOOST_HAS_DEFAULTED_FUNCTIONS)
 
- #define BOOST_DEFAULT_CONSTRUCTOR_DEFAULT(T) \
- T()=default; \
+ #define BOOST_DEFAULT_CONSTRUCTOR_DCL_DEFAULT(T) \
+ T()=default;
+
+ #define BOOST_DEFAULT_CONSTRUCTOR_DEF_DEFAULT(T) \
+ T::T()=default;
 
- #define BOOST_COPY_ASSIGNEMENT_DEFAULT(T) \
- T& operator=(const T& rhs)=default; \
+ #define BOOST_COPY_ASSIGNEMENT_DCL=DEFAULT(T) \
+ T& operator=(const T& rhs)=default;
+
+ #define BOOST_COPY_ASSIGNEMENT_DEF=DEFAULT(T) \
+ T& T::operator=(const T& rhs)=default;
 
 #else // !defined(BOOST_HAS_DEFAULTED_FUNCTIONS)
 
+ #define BOOST_DEFAULT_CONSTRUCTOR_DCL_DEFAULT(T) \
+ T(){};
+
     #define BOOST_DEFAULT_CONSTRUCTOR_DEFAULT(T) \
- inline T(){}; \
+ T(){};
+
+ #define BOOST_DEFAULT_CONSTRUCTOR_DEF_DEFAULT(T) \
+ T::T(){};
+
+
+ #define BOOST_COPY_ASSIGNEMENT_DCL_DEFAULT(T) \
+ T& operator=(const T& rhs) { \
+ T tmp(rhs); \
+ swap(tmp); \
+ return this; \
+ }
 
- #define BOOST_COPY_ASSIGNEMENT_DEFAULT(T) \
- inline T& operator=(const T& rhs) { \
- T tmp(rhs); \
- swap(tmp);\
- return this;\
+ #define BOOST_COPY_ASSIGNEMENT_DEF_DEFAULT(T) \
+ T& T::operator=(const T& rhs) { \
+ T tmp(rhs); \
+ swap(tmp); \
+ return this; \
       }
 
 #endif // !defined(BOOST_HAS_DEFAULTED_FUNCTIONS)

Added: sandbox/synchro/boost/synchro/lockable/functions.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/functions.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,66 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_FUNCTIONS__HPP
+#define BOOST_SYNCHRO_LOCKABLE_FUNCTIONS__HPP
+
+#include <boost/synchro/lockable/lock.hpp>
+#include <boost/synchro/lockable/try_lock.hpp>
+#include <boost/synchro/lockable/unlock.hpp>
+#include <boost/synchro/lockable/lock_until.hpp>
+#include <boost/synchro/lockable/lock_for.hpp>
+#include <boost/synchro/lockable/try_lock_until.hpp>
+#include <boost/synchro/lockable/try_lock_for.hpp>
+
+#include <boost/synchro/lockable/lock_shared.hpp>
+#include <boost/synchro/lockable/try_lock_shared.hpp>
+#include <boost/synchro/lockable/unlock_shared.hpp>
+#include <boost/synchro/lockable/lock_shared_until.hpp>
+#include <boost/synchro/lockable/lock_shared_for.hpp>
+#include <boost/synchro/lockable/try_lock_shared_until.hpp>
+#include <boost/synchro/lockable/try_lock_shared_for.hpp>
+
+#include <boost/synchro/lockable/lock_upgrade.hpp>
+#include <boost/synchro/lockable/lock_upgrade_until.hpp>
+#include <boost/synchro/lockable/lock_upgrade_for.hpp>
+
+#include <boost/synchro/lockable/try_lock_upgrade.hpp>
+#include <boost/synchro/lockable/try_lock_upgrade_until.hpp>
+#include <boost/synchro/lockable/try_lock_upgrade_for.hpp>
+
+#include <boost/synchro/lockable/unlock_upgrade.hpp>
+
+#include <boost/synchro/lockable/unlock_and_lock_upgrade.hpp>
+#include <boost/synchro/lockable/unlock_and_lock_shared.hpp>
+
+#include <boost/synchro/lockable/unlock_upgrade_and_lock_shared.hpp>
+
+#include <boost/synchro/lockable/unlock_upgrade_and_lock.hpp>
+#include <boost/synchro/lockable/unlock_upgrade_and_lock_until.hpp>
+#include <boost/synchro/lockable/unlock_upgrade_and_lock_for.hpp>
+
+#include <boost/synchro/lockable/try_unlock_upgrade_and_lock.hpp>
+#include <boost/synchro/lockable/try_unlock_upgrade_and_lock_until.hpp>
+#include <boost/synchro/lockable/try_unlock_upgrade_and_lock_for.hpp>
+
+
+#include <boost/synchro/lockable/unlock_shared_and_lock.hpp>
+//#include <boost/synchro/lockable/unlock_shared_and_lock_until.hpp>
+//#include <boost/synchro/lockable/unlock_shared_and_lock_for.hpp>
+
+#include <boost/synchro/lockable/try_unlock_shared_and_lock.hpp>
+//#include <boost/synchro/lockable/try_unlock_shared_and_lock_until.hpp>
+//#include <boost/synchro/lockable/try_unlock_shared_and_lock_for.hpp>
+
+#include <boost/synchro/lockable/try_unlock_shared_and_lock_upgrade.hpp>
+//#include <boost/synchro/lockable/try_unlock_shared_and_lock_upgrade_until.hpp>
+//#include <boost/synchro/lockable/try_unlock_shared_and_lock_upgrade_for.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,53 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_LOCK__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+//!\file
+//!Describes a generic free lock function that can be applied to any model of the Lockable concept
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct lock {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct lock {
+ static typename result_of::template lock<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.lock();
+ }
+ };
+ }
+
+ //!Effects: The calling thread tries to obtain ownership of the lockable, and
+ //! if another thread has ownership of the lockable, it waits until it can
+ //! obtain the ownership. If a thread takes ownership of the lockable the
+ //! lockable must be unlocked by the same thread.
+ //!Throws: boost::system_exception on error.
+ template <typename Lockable>
+ typename result_of::template lock<Lockable>::type
+ lock(Lockable& lockable) {
+ return partial_specialization_workaround::lock<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_LOCK_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_FOR__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct lock_for {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Rep, class Period >
+ struct lock_for {
+ static void
+ apply( Lockable& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ lockable.lock_for(rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Rep, class Period >
+ void
+ lock_for(Lockable& lockable, const chrono::duration<Rep, Period>& abs_time) {
+ partial_specialization_workaround::lock_for<Lockable,Rep,Period>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_shared.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_shared.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_LOCK_SHARED__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_SHARED__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct lock_shared {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct lock_shared {
+ static typename result_of::template lock_shared<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.lock_shared();
+ }
+ };
+ }
+
+ template <typename Lockable>
+ typename result_of::template lock_shared<Lockable>::type
+ lock_shared(Lockable& lockable) {
+ return partial_specialization_workaround::lock_shared<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_shared_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_shared_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_LOCK_SHARED_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_SHARED_FOR__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct lock_shared_for {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Rep, class Period >
+ struct lock_shared_for {
+ static void
+ apply( Lockable& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.lock_shared_for(rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Rep, class Period >
+ void
+ lock_shared_for(Lockable& lockable, const chrono::duration<Rep, Period>& abs_time) {
+ return partial_specialization_workaround::lock_shared_for<Lockable,Rep,Period>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_shared_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_shared_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_LOCK_SHARED_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_SHARED_UNTIL__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Clock, class Duration >
+ struct lock_shared_until {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Clock, class Duration >
+ struct lock_shared_until {
+ static void
+ apply( Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.lock_shared_until(abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Clock, class Duration >
+ void
+ lock_shared_until(Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::lock_shared_until<Lockable,Clock,Duration>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_LOCK_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_UNTIL__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Clock, class Duration >
+ struct lock_until {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Clock, class Duration >
+ struct lock_until {
+ static void
+ apply( Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.lock_until(abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Clock, class Duration >
+ void
+ lock_until(Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::lock_until<Lockable,Clock,Duration>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_upgrade.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_upgrade.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_LOCK_UPGRADE__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_UPGRADE__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct lock_upgrade {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct lock_upgrade {
+ static typename result_of::template lock_upgrade<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.lock_upgrade();
+ }
+ };
+ }
+
+ template <typename Lockable>
+ typename result_of::template lock_upgrade<Lockable>::type
+ lock_upgrade(Lockable& lockable) {
+ return partial_specialization_workaround::lock_upgrade<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_upgrade_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_upgrade_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_LOCK_UPGRADE_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_UPGRADE_FOR__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct lock_upgrade_for {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Rep, class Period >
+ struct lock_upgrade_for {
+ static void
+ apply( Lockable& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.lock_upgrade_for(rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Rep, class Period >
+ void
+ lock_upgrade_for(Lockable& lockable, const chrono::duration<Rep, Period>& abs_time) {
+ return partial_specialization_workaround::lock_upgrade_for<Lockable,Rep,Period>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_upgrade_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_upgrade_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_LOCK_UPGRADE_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_UPGRADE_UNTIL__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Clock, class Duration >
+ struct lock_upgrade_until {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Clock, class Duration >
+ struct lock_upgrade_until {
+ static void
+ apply( Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.lock_upgrade_until(abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Clock, class Duration >
+ void
+ lock_upgrade_until(Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::lock_upgrade_until<Lockable,Clock,Duration>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_lock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_lock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_LOCK__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_LOCK__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct try_lock {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct try_lock {
+ static typename result_of::template try_lock<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.try_lock();
+ }
+ };
+ }
+
+ template <typename Lockable>
+ typename result_of::template try_lock<Lockable>::type
+ try_lock(Lockable& lockable) {
+ return partial_specialization_workaround::try_lock<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_lock_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_lock_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_FOR__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Rep, class Period >
+ struct try_lock_for {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Rep, class Period >
+ struct try_lock_for {
+ static typename result_of::template try_lock_for<Lockable, Rep, Period>::type
+ apply( Lockable& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.try_lock_for(rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Rep, class Period >
+ typename result_of::template try_lock_for<Lockable, Rep, Period>::type
+ try_lock_for(Lockable& lockable, const chrono::duration<Rep, Period>& rel_time) {
+ return partial_specialization_workaround::try_lock_for<Lockable,Rep,Period>::apply(lockable, rel_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_lock_shared.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_lock_shared.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_SHARED__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_SHARED__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct try_lock_shared {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct try_lock_shared {
+ static typename result_of::template try_lock_shared<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.try_lock_shared();
+ }
+ };
+ }
+
+ template <typename Lockable>
+ typename result_of::template try_lock_shared<Lockable>::type
+ try_lock_shared(Lockable& lockable) {
+ return partial_specialization_workaround::try_lock_shared<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_lock_shared_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_lock_shared_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_SHARED_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_SHARED_FOR__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Rep, class Period >
+ struct try_lock_shared_for {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Rep, class Period >
+ struct try_lock_shared_for {
+ static typename result_of::template try_lock_shared_for<Lockable,Rep, Period>::type
+ apply( Lockable& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.try_lock_shared_for(rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Rep, class Period >
+ typename result_of::template try_lock_shared_for<Lockable,Rep, Period>::type
+ try_lock_shared_for(Lockable& lockable, const chrono::duration<Rep, Period>& rel_time) {
+ return partial_specialization_workaround::try_lock_shared_for<Lockable,Rep, Period>::apply(lockable, rel_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_lock_shared_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_lock_shared_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_UPGRADE_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_UPGRADE_UNTIL__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Clock, class Duration >
+ struct try_lock_upgrade_until {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Clock, class Duration >
+ struct try_lock_upgrade_until {
+ static typename result_of::template try_lock_upgrade_until<Lockable,Clock,Duration>::type
+ apply( Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.try_lock_upgrade_until(abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Clock, class Duration >
+ typename result_of::template try_lock_upgrade_until<Lockable,Clock,Duration>::type
+ try_lock_upgrade_until(Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::try_lock_upgrade_until<Lockable,Clock,Duration>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_lock_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_lock_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_UNTIL__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Clock, class Duration >
+ struct try_lock_until {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Clock, class Duration >
+ struct try_lock_until {
+ static typename result_of::template try_lock_until<Lockable,Clock, Duration>::type
+ apply( Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.try_lock_until(abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Clock, class Duration >
+ typename result_of::template try_lock_until<Lockable,Clock, Duration>::type
+ try_lock_until(Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::try_lock_until<Lockable,Clock,Duration>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_lock_upgrade.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_lock_upgrade.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_UPGRADE__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_UPGRADE__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct try_lock_upgrade {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct try_lock_upgrade {
+ static typename result_of::template try_lock_upgrade<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.try_lock_upgrade();
+ }
+ };
+ }
+
+ template <typename Lockable>
+ typename result_of::template try_lock_upgrade<Lockable>::type
+ try_lock_upgrade(Lockable& lockable) {
+ return partial_specialization_workaround::try_lock_upgrade<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_lock_upgrade_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_lock_upgrade_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_UPGRADE_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_UPGRADE_FOR__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Rep, class Period >
+ struct try_lock_upgrade_for {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Rep, class Period >
+ struct try_lock_upgrade_for {
+ static typename result_of::template try_lock_upgrade_for<Lockable,Rep, Period>::type
+ apply( Lockable& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.try_lock_upgrade_for(rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Rep, class Period >
+ typename result_of::template try_lock_upgrade_for<Lockable,Rep, Period>::type
+ try_lock_upgrade_for(Lockable& lockable, const chrono::duration<Rep, Period>& rel_time) {
+ return partial_specialization_workaround::try_lock_upgrade_for<Lockable,Rep, Period>::apply(lockable, rel_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_lock_upgrade_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_lock_upgrade_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_SHARED_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_LOCK_SHARED_UNTIL__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Clock, class Duration >
+ struct try_lock_shared_until {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Clock, class Duration >
+ struct try_lock_shared_until {
+ static typename result_of::template try_lock_shared_until<Lockable,Clock,Duration>::type
+ apply( Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.try_lock_shared_until(abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Clock, class Duration >
+ typename result_of::template try_lock_shared_until<Lockable,Clock,Duration>::type
+ try_lock_shared_until(Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::try_lock_shared_until<Lockable,Clock,Duration>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_unlock_shared_and_lock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_unlock_shared_and_lock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_SHARED_AND_LOCK__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_SHARED_AND_LOCK__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable >
+ struct try_unlock_shared_and_lock {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable>
+ struct try_unlock_shared_and_lock {
+ static typename result_of::template try_unlock_shared_and_lock<Lockable>::type
+ apply( Lockable& lockable) {
+ return lockable.try_unlock_shared_and_lock();
+ }
+ };
+ }
+
+ template <typename Lockable >
+ typename result_of::template try_unlock_shared_and_lock<Lockable>::type
+ try_unlock_shared_and_lock(Lockable& lockable) {
+ return partial_specialization_workaround::try_unlock_shared_and_lock<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_unlock_shared_and_lock_upgrade.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_unlock_shared_and_lock_upgrade.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_SHARED_AND_LOCK_UPGRADE__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_SHARED_AND_LOCK_UPGRADE__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable >
+ struct try_unlock_shared_and_lock_upgrade {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable>
+ struct try_unlock_shared_and_lock_upgrade {
+ static typename result_of::template try_unlock_shared_and_lock_upgrade<Lockable>::type
+ apply( Lockable& lockable) {
+ return lockable.try_unlock_shared_and_lock_upgrade();
+ }
+ };
+ }
+
+ template <typename Lockable >
+ typename result_of::template try_unlock_shared_and_lock_upgrade<Lockable>::type
+ try_unlock_shared_and_lock_upgrade(Lockable& lockable) {
+ return partial_specialization_workaround::try_unlock_shared_and_lock_upgrade<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_unlock_upgrade_and_lock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_unlock_upgrade_and_lock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_SHARED_AND_LOCK__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_SHARED_AND_LOCK__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable >
+ struct try_unlock_shared_and_lock {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable>
+ struct try_unlock_shared_and_lock {
+ static typename result_of::template try_unlock_shared_and_lock<Lockable>::type
+ apply( Lockable& lockable) {
+ return lockable.try_unlock_shared_and_lock();
+ }
+ };
+ }
+
+ template <typename Lockable >
+ typename result_of::template try_unlock_shared_and_lock<Lockable>::type
+ try_unlock_shared_and_lock(Lockable& lockable) {
+ return partial_specialization_workaround::try_unlock_shared_and_lock<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_unlock_upgrade_and_lock_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_unlock_upgrade_and_lock_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_UPGRADE_AND_LOCK_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_UPGRADE_AND_LOCK_FOR__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Rep, class Period >
+ struct try_unlock_upgrade_and_lock_for {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Rep, class Period >
+ struct try_unlock_upgrade_and_lock_for {
+ static typename result_of::template try_unlock_upgrade_and_lock_for<Lockable,Rep, Period>::type
+ apply( Lockable& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.try_unlock_upgrade_and_lock_for(rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Rep, class Period >
+ typename result_of::template try_unlock_upgrade_and_lock_for<Lockable,Rep, Period>::type
+ try_unlock_upgrade_and_lock_for(Lockable& lockable, const chrono::duration<Rep, Period>& rel_time) {
+ return partial_specialization_workaround::try_unlock_upgrade_and_lock_for<Lockable,Rep, Period>::apply(lockable, rel_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/try_unlock_upgrade_and_lock_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/try_unlock_upgrade_and_lock_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_UPGRADE_AND_LOCK_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_TRY_UNLOCK_UPGRADE_AND_LOCK_UNTIL__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Clock, class Duration >
+ struct try_unlock_upgrade_and_lock_until {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Clock, class Duration >
+ struct try_unlock_upgrade_and_lock_until {
+ static typename result_of::template try_unlock_upgrade_and_lock_until<Lockable,Clock,Duration>::type
+ apply( Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.try_unlock_upgrade_and_lock_until(abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Clock, class Duration >
+ typename result_of::template try_unlock_upgrade_and_lock_until<Lockable,Clock,Duration>::type
+ try_unlock_upgrade_and_lock_until(Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::try_unlock_upgrade_and_lock_until<Lockable,Clock,Duration>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct unlock {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct unlock {
+ static typename result_of::template unlock<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.unlock();
+ }
+ };
+ }
+
+ template <typename Lockable>
+ typename result_of::template unlock<Lockable>::type
+ unlock(Lockable& lockable) {
+ return partial_specialization_workaround::unlock<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock_and_lock_shared.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock_and_lock_shared.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,53 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK_AND_LOCK_SHARED__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK_AND_LOCK_SHARED__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+//!\file
+//!Describes a generic free unlock_and_lock_shared function that can be applied to any model of the Lockable concept
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct unlock_and_lock_shared {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct unlock_and_lock_shared {
+ static typename result_of::template unlock_and_lock_shared<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.unlock_and_lock_shared();
+ }
+ };
+ }
+
+ //!Effects: The calling thread tries to obtain ownership of the lockable, and
+ //! if another thread has ownership of the lockable, it waits until it can
+ //! obtain the ownership. If a thread takes ownership of the lockable the
+ //! lockable must be unlocked by the same thread.
+ //!Throws: boost::system_exception on error.
+ template <typename Lockable>
+ typename result_of::template unlock_and_lock_shared<Lockable>::type
+ unlock_and_lock_shared(Lockable& lockable) {
+ return partial_specialization_workaround::unlock_and_lock_shared<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock_and_lock_upgrade.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock_and_lock_upgrade.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,53 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK_AND_LOCK_UPGRADE__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK_AND_LOCK_UPGRADE__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+//!\file
+//!Describes a generic free unlock_and_lock_upgrade function that can be applied to any model of the Lockable concept
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct unlock_and_lock_upgrade {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct unlock_and_lock_upgrade {
+ static typename result_of::template unlock_and_lock_upgrade<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.unlock_and_lock_upgrade();
+ }
+ };
+ }
+
+ //!Effects: The calling thread tries to obtain ownership of the lockable, and
+ //! if another thread has ownership of the lockable, it waits until it can
+ //! obtain the ownership. If a thread takes ownership of the lockable the
+ //! lockable must be unlocked by the same thread.
+ //!Throws: boost::system_exception on error.
+ template <typename Lockable>
+ typename result_of::template unlock_and_lock_upgrade<Lockable>::type
+ unlock_and_lock_upgrade(Lockable& lockable) {
+ return partial_specialization_workaround::unlock_and_lock_upgrade<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock_shared.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock_shared.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK_SHARED__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK_SHARED__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct unlock_shared {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct unlock_shared {
+ static typename result_of::template unlock_shared<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.unlock_shared();
+ }
+ };
+ }
+
+ template <typename Lockable>
+ typename result_of::template unlock_shared<Lockable>::type
+ unlock_shared(Lockable& lockable) {
+ return partial_specialization_workaround::unlock_shared<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock_shared_and_lock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock_shared_and_lock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,54 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK_SHARED_AND_LOCK__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK_SHARED_AND_LOCK__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+//!\file
+//!Describes a generic free unlock_shared_and_lock function that can be applied to any model of the Lockable concept
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct unlock_shared_and_lock {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct unlock_shared_and_lock {
+ static typename result_of::template unlock_shared_and_lock<Lockable>::type apply( Lockable& lockable )
+ {
+ return lockable.unlock_shared_and_lock();
+ }
+ };
+ }
+
+ //!Effects: The calling thread tries to obtain ownership of the lockable, and
+ //! if another thread has ownership of the lockable, it waits until it can
+ //! obtain the ownership. If a thread takes ownership of the lockable the
+ //! lockable must be unlocked by the same thread.
+ //!Throws: boost::system_exception on error.
+ template <typename Lockable>
+ typename result_of::template unlock_shared_and_lock<Lockable>::type
+ unlock_shared_and_lock(Lockable& lockable) {
+ return partial_specialization_workaround::unlock_shared_and_lock<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock_upgrade.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock_upgrade.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,45 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct unlock_upgrade {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct unlock_upgrade {
+ static typename result_of::template unlock_upgrade<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.unlock_upgrade();
+ }
+ };
+ }
+
+ template <typename Lockable>
+ typename result_of::template unlock_upgrade<Lockable>::type
+ unlock_upgrade(Lockable& lockable) {
+ return partial_specialization_workaround::unlock_upgrade<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,54 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE_AND_LOCK__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE_AND_LOCK__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+//!\file
+//!Describes a generic free unlock_upgrade_and_lock function that can be applied to any model of the Lockable concept
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct unlock_upgrade_and_lock {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct unlock_upgrade_and_lock {
+ static typename result_of::template unlock_upgrade_and_lock<Lockable>::type apply( Lockable& lockable )
+ {
+ return lockable.unlock_upgrade_and_lock();
+ }
+ };
+ }
+
+ //!Effects: The calling thread tries to obtain ownership of the lockable, and
+ //! if another thread has ownership of the lockable, it waits until it can
+ //! obtain the ownership. If a thread takes ownership of the lockable the
+ //! lockable must be unlocked by the same thread.
+ //!Throws: boost::system_exception on error.
+ template <typename Lockable>
+ typename result_of::template unlock_upgrade_and_lock<Lockable>::type
+ unlock_upgrade_and_lock(Lockable& lockable) {
+ return partial_specialization_workaround::unlock_upgrade_and_lock<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE_AND_LOCK_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE_AND_LOCK_FOR__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct unlock_upgrade_and_lock_for {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Rep, class Period >
+ struct unlock_upgrade_and_lock_for {
+ static void
+ apply( Lockable& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.unlock_upgrade_and_lock_for(rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Rep, class Period >
+ void
+ unlock_upgrade_and_lock_for(Lockable& lockable, const chrono::duration<Rep, Period>& abs_time) {
+ return partial_specialization_workaround::unlock_upgrade_and_lock_for<Lockable,Rep,Period>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock_shared.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock_shared.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,53 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE_AND_LOCK_SHARED__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE_AND_LOCK_SHARED__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+//!\file
+//!Describes a generic free unlock_upgrade_and_lock_shared function that can be applied to any model of the Lockable concept
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct unlock_upgrade_and_lock_shared {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct unlock_upgrade_and_lock_shared {
+ static typename result_of::template unlock_upgrade_and_lock_shared<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.unlock_upgrade_and_lock_shared();
+ }
+ };
+ }
+
+ //!Effects: The calling thread tries to obtain ownership of the lockable, and
+ //! if another thread has ownership of the lockable, it waits until it can
+ //! obtain the ownership. If a thread takes ownership of the lockable the
+ //! lockable must be unlocked by the same thread.
+ //!Throws: boost::system_exception on error.
+ template <typename Lockable>
+ typename result_of::template unlock_upgrade_and_lock_shared<Lockable>::type
+ unlock_upgrade_and_lock_shared(Lockable& lockable) {
+ return partial_specialization_workaround::unlock_upgrade_and_lock_shared<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/unlock_upgrade_and_lock_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE_AND_LOCK_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_UNLOCK_UPGRADE_AND_LOCK_UNTIL__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, class Clock, class Duration >
+ struct unlock_upgrade_and_lock_until {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Clock, class Duration >
+ struct unlock_upgrade_and_lock_until {
+ static void
+ apply( Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.unlock_upgrade_and_lock_until(abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Clock, class Duration >
+ void
+ unlock_upgrade_and_lock_until(Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::unlock_upgrade_and_lock_until<Lockable,Clock,Duration>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Modified: sandbox/synchro/boost/synchro/lockable_adapter.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/lockable_adapter.hpp (original)
+++ sandbox/synchro/boost/synchro/lockable_adapter.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -15,6 +15,7 @@
 #include <boost/synchro/timeout_exception.hpp>
 #include <boost/synchro/detail/deleted_functions.hpp>
 #include <boost/thread/thread_time.hpp>
+#include <boost/chrono/chrono.hpp>
 
 namespace boost { namespace synchro {
 
@@ -59,12 +60,27 @@
     template<typename TimeDuration>
     bool try_lock_for(TimeDuration const & relative_time)
     {return the_lock().try_lock_for(relative_time);}
+
+ template<typename Clock, typename Duration>
+ bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {return the_lock().try_lock_until(abs_time);}
+ template<typename Rep, typename Period>
+ bool try_lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {return the_lock().try_lock_for(rel_time);}
     
     void lock_until(system_time const & abs_time)
     {the_lock().lock_until(abs_time);}
     template<typename TimeDuration>
     void lock_for(TimeDuration const & relative_time)
     {the_lock().lock_for(relative_time);}
+
+ template<typename Clock, typename Duration>
+ void lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {the_lock().lock_until(abs_time);}
+
+ template<typename Rep, typename Period>
+ void lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {the_lock().lock_for(rel_time);}
     
 protected:
     TimedLock& the_lock() {return *static_cast<TimedLock*>(&this->lock_);}
@@ -93,12 +109,26 @@
     template<typename TimeDuration>
     bool try_lock_shared_for(TimeDuration const& t)
     {return the_lock().try_lock_shared_for(t);}
+
+ template<typename Clock, typename Duration>
+ bool try_lock_shared_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {return the_lock().try_lock_shared_until(abs_time);}
+ template<typename Rep, typename Period>
+ bool try_lock_shared_for(chrono::duration<Rep, Period> const & rel_time)
+ {return the_lock().try_lock_shared_for(rel_time);}
     
     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);}
+
+ template<typename Clock, typename Duration>
+ void lock_shared_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {the_lock().lock_shared_until(abs_time);}
+ template<typename Rep, typename Period>
+ void lock_shared_for(chrono::duration<Rep, Period> const & rel_time)
+ {the_lock().lock_shared_for(rel_time);}
 
 protected:
     SharableLock& the_lock() {return *static_cast<SharableLock*>(&this->lock_);}
@@ -138,12 +168,28 @@
     template<typename TimeDuration>
     bool try_lock_upgrade_for(TimeDuration const&t)
     {return the_lock().try_lock_upgrade_for(t);}
+
+ template<typename Clock, typename Duration>
+ bool try_lock_upgrade_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {return the_lock().try_lock_upgrade_until(abs_time);}
+
+ template<typename Rep, typename Period>
+ bool try_lock_upgrade_for(chrono::duration<Rep, Period> const & rel_time)
+ {return the_lock().try_lock_upgrade_for(rel_time);}
+
     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);}
 
+ template<typename Clock, typename Duration>
+ void lock_upgrade_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {the_lock().lock_upgrade_until(abs_time);}
+
+ template<typename Rep, typename Period>
+ void lock_upgrade_for(chrono::duration<Rep, Period> const & rel_time)
+ {the_lock().try_lock_upgrade_for(rel_time);}
 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-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -12,8 +12,11 @@
 #define BOOST_SYNCHRO_LOCKABLE_CONCEPTS_HPP
 
 #include <boost/synchro/lockable_traits.hpp>
+#include <boost/synchro/lockable/functions.hpp>
 #include <boost/date_time/posix_time/ptime.hpp>
 #include <boost/thread/thread_time.hpp>
+#include <boost/chrono/chrono.hpp>
+
 #include <boost/concept_check.hpp>
 namespace boost { namespace synchro {
 
@@ -35,9 +38,9 @@
     typedef typename naming_tag<Lockable>::type naming;
 
     BOOST_CONCEPT_USAGE(LockableConcept) {
- l.lock();
- l.unlock();
- l.try_lock();
+ lockable::lock(l);
+ lockable::unlock(l);
+ lockable::try_lock(l);
     }
     Lockable& l;
 };
@@ -53,13 +56,13 @@
     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(boost::posix_time::seconds(1));
+ lockable::lock_until(l, t);
+ lockable::lock_for(l, boost::chrono::seconds(1));
+ lockable::try_lock_until(l, t);
+ lockable::try_lock_for(l, boost::chrono::seconds(1));
     }
     Lockable& l;
- system_time t;
+ boost::chrono::system_clock::time_point t;
 };
 //]
 bool pred();
@@ -72,13 +75,13 @@
     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.lock_when_for(c, pred, boost::chrono::seconds(1));
         l.relock_on(t);
         l.relock_on_until(c, t);
- l.relock_on_for(c, boost::posix_time::seconds(1));
+ l.relock_on_for(c, boost::chrono::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));
+ l.relock_when_for(c, pred, boost::chrono::seconds(1));
         c.notify_one();
         c.notify_all();
     }
@@ -100,16 +103,16 @@
     BOOST_CONCEPT_ASSERT((TimedLockableConcept<Lockable>));
 
     BOOST_CONCEPT_USAGE(ShareLockableConcept) {
- l.lock_shared();
- 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::lock_shared(l);
+ lockable::lock_shared_until(l, t);
+ lockable::lock_shared_for(l, boost::chrono::seconds(1));
+ lockable::try_lock_shared(l);
+ lockable::try_lock_shared_until(l, t);
+ lockable::try_lock_shared_for(l, boost::chrono::seconds(1));
+ lockable::unlock_shared(l);
     }
     Lockable& l;
- system_time t;
+ boost::chrono::system_clock::time_point t;
 };
 //]
 
@@ -126,19 +129,19 @@
     BOOST_CONCEPT_ASSERT((ShareLockableConcept<Lockable>));
 
     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_for(boost::posix_time::seconds(1));
- l.unlock_upgrade_and_lock();
- l.unlock_and_lock_upgrade();
- l.unlock_and_lock_shared();
- l.unlock_upgrade_and_lock_shared();
+ lockable::lock_upgrade(l);
+ //lockable::lock_upgrade_until(l, t);
+ //lockable::lock_upgrade_for(l, boost::chrono::seconds(1));
+ lockable::try_lock_upgrade(l);
+ //lockable::try_lock_upgrade_until(l, t);
+ //lockable::try_lock_upgrade_for(l,boost::chrono::seconds(1));
+ lockable::unlock_upgrade_and_lock(l);
+ lockable::unlock_and_lock_upgrade(l);
+ lockable::unlock_and_lock_shared(l);
+ lockable::unlock_upgrade_and_lock_shared(l);
     }
     Lockable& l;
- system_time t;
+ boost::chrono::system_clock::time_point t;
 };
 //]
 

Added: sandbox/synchro/boost/synchro/lockables/detail/is_mutex_type.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/detail/is_mutex_type.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,26 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_IS_LOCKABLE__HPP
+#define BOOST_SYNCHRO_IS_LOCKABLE__HPP
+
+#include <boost/detail/workaround.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro {
+
+ template<typename T>
+ struct is_lockable
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+
+
+}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,23 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_IS_MUTEX_TYPE_WRAPPER__HPP
+#define BOOST_SYNCHRO_LOCKABLES_IS_MUTEX_TYPE_WRAPPER__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+
+ namespace detail
+ {
+ template<bool x>
+ struct is_mutex_type_wrapper
+ {};
+ }
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/detail/lock_until_internal.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/detail/lock_until_internal.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,68 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_LOCK_UNTIL_INTERNAL__HPP
+#define BOOST_SYNCHRO_LOCKABLES_LOCK_UNTIL_INTERNAL__HPP
+
+#include <boost/synchro/lockable/lock_until.hpp>
+#include <boost/synchro/lockers.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables { namespace detail {
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration>
+ void lock_until_internal(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2)
+ {
+ unique_locker<MutexType1> l1(abs_time,m1);
+ lockable::lock_until(m2,abs_time);
+ l1.release();
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3, class Clock, class Duration>
+ void lock_until_internal(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3)
+ {
+ unique_locker<MutexType1> l1(abs_time,m1);
+ unique_locker<MutexType1> l2(abs_time,m2);
+ lockable::lock_until(m3,abs_time);
+ l1.release();
+ l2.release();
+ }
+
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4, class Clock, class Duration>
+ void lock_until_internal(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4)
+ {
+ unique_locker<MutexType1> l1(abs_time,m1);
+ unique_locker<MutexType1> l2(abs_time,m2);
+ unique_locker<MutexType1> l3(abs_time,m3);
+ lockable::lock_until(m4,abs_time);
+ l1.release();
+ l2.release();
+ l3.release();
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4,typename MutexType5, class Clock, class Duration>
+ void lock_until_internal(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4,MutexType5& m5)
+ {
+ unique_locker<MutexType1> l1(abs_time,m1);
+ unique_locker<MutexType1> l2(abs_time,m2);
+ unique_locker<MutexType1> l3(abs_time,m3);
+ unique_locker<MutexType1> l4(abs_time,m4);
+ lockable::lock_until(m5,abs_time);
+ l1.release();
+ l2.release();
+ l3.release();
+ l4.release();
+ }
+}}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/detail/range_lock_guard.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/detail/range_lock_guard.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,43 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_RANGE_LOCK_GUARD_HPP
+#define BOOST_SYNCHRO_LOCKABLES_RANGE_LOCK_GUARD_HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+ namespace detail {
+ template<typename Iterator>
+ struct range_lock_guard
+ {
+ Iterator begin;
+ Iterator end;
+
+ range_lock_guard(Iterator begin_,Iterator end_):
+ begin(begin_),end(end_)
+ {
+ lockables::lock(begin,end);
+ }
+
+ void release()
+ {
+ begin=end;
+ }
+
+ ~range_lock_guard()
+ {
+ for(;begin!=end;++begin)
+ {
+ unlock(*begin);
+ }
+ }
+ };
+ }
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/detail/try_lock_internal.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/detail/try_lock_internal.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,89 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_INTERNAL__HPP
+#define BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_INTERNAL__HPP
+
+#include <boost/synchro/lockable/try_lock.hpp>
+#include <boost/synchro/lockers.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables { namespace detail {
+
+ template<typename MutexType1,typename MutexType2>
+ unsigned try_lock_internal(MutexType1& m1,MutexType2& m2)
+ {
+ unique_locker<MutexType1> l1(m1,boost::try_to_lock);
+ if(!l1)
+ {
+ return 1;
+ }
+ if(!lockable::try_lock(m2))
+ {
+ return 2;
+ }
+ l1.release();
+ return 0;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3>
+ unsigned try_lock_internal(MutexType1& m1,MutexType2& m2,MutexType3& m3)
+ {
+ unique_locker<MutexType1> l1(m1,boost::try_to_lock);
+ if(!l1)
+ {
+ return 1;
+ }
+ if(unsigned const failed_lock=try_lock_internal(m2,m3))
+ {
+ return failed_lock+1;
+ }
+ l1.release();
+ return 0;
+ }
+
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4>
+ unsigned try_lock_internal(MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4)
+ {
+ unique_locker<MutexType1> l1(m1,boost::try_to_lock);
+ if(!l1)
+ {
+ return 1;
+ }
+ if(unsigned const failed_lock=try_lock_internal(m2,m3,m4))
+ {
+ return failed_lock+1;
+ }
+ l1.release();
+ return 0;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4,typename MutexType5>
+ unsigned try_lock_internal(MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4,MutexType5& m5)
+ {
+ unique_locker<MutexType1> l1(m1,boost::try_to_lock);
+ if(!l1)
+ {
+ return 1;
+ }
+ if(unsigned const failed_lock=try_lock_internal(m2,m3,m4,m5))
+ {
+ return failed_lock+1;
+ }
+ l1.release();
+ return 0;
+ }
+
+}}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/detail/try_lock_until_internal.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/detail/try_lock_until_internal.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,87 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_UNTIL_INTERNAL__HPP
+#define BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_UNTIL_INTERNAL__HPP
+#include <boost/synchro/lockable/try_lock_until.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables { namespace detail {
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration>
+ unsigned try_lock_until_internal(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2)
+ {
+ unique_locker<MutexType1> l1(m1,abs_time);
+ if(!l1)
+ {
+ return 1;
+ }
+ if(!lockable::try_lock_until(m2,abs_time))
+ {
+ return 2;
+ }
+ l1.release();
+ return 0;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3, class Clock, class Duration>
+ unsigned try_lock_until_internal(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3)
+ {
+ unique_locker<MutexType1> l1(m1,abs_time);
+ if(!l1)
+ {
+ return 1;
+ }
+ if(unsigned const failed_lock=try_lock_until_internal(abs_time, m2,m3))
+ {
+ return failed_lock+1;
+ }
+ l1.release();
+ return 0;
+ }
+
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4, class Clock, class Duration>
+ unsigned try_lock_until_internal(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4)
+ {
+ unique_locker<MutexType1> l1(m1,abs_time);
+ if(!l1)
+ {
+ return 1;
+ }
+ if(unsigned const failed_lock=try_lock_until_internal(abs_time,m2,m3,m4))
+ {
+ return failed_lock+1;
+ }
+ l1.release();
+ return 0;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4,typename MutexType5, class Clock, class Duration>
+ unsigned try_lock_until_internal(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4,MutexType5& m5)
+ {
+ unique_locker<MutexType1> l1(m1,abs_time);
+ if(!l1)
+ {
+ return 1;
+ }
+ if(unsigned const failed_lock=try_lock_until_internal(abs_time, m2,m3,m4,m5))
+ {
+ return failed_lock+1;
+ }
+ l1.release();
+ return 0;
+ }
+
+}}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/functions.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/functions.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,22 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009.
+// 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_FUNCTIONS__HPP
+#define BOOST_SYNCHRO_LOCKABLES_FUNCTIONS__HPP
+
+#include <boost/synchro/lockables/lock.hpp>
+#include <boost/synchro/lockables/try_lock.hpp>
+#include <boost/synchro/lockables/unlock.hpp>
+#include <boost/synchro/lockables/lock_until.hpp>
+#include <boost/synchro/lockables/lock_for.hpp>
+#include <boost/synchro/lockables/try_lock_until.hpp>
+#include <boost/synchro/lockables/try_lock_for.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/lock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/lock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,396 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_LOCK_HPP
+#define BOOST_SYNCHRO_LOCKABLES_LOCK_HPP
+
+#include <algorithm>
+#include <iterator>
+
+#include <boost/thread/locks.hpp>
+#include <boost/synchro/lockables/detail/try_lock_internal.hpp>
+#include <boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp>
+//#include <boost/synchro/lockables/detail/range_lock_guard.hpp>
+#include <boost/synchro/lockables/try_lock.hpp>
+#include <boost/synchro/lockable/try_lock.hpp>
+#include <boost/synchro/lockable/unlock.hpp>
+#include <boost/synchro/is_lockable.hpp>
+#include <boost/synchro/lockers.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/fusion/include/for_each.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+ namespace fct {
+ struct lock {
+ typedef void result_type;
+ template<typename Lockable>
+ void operator()(Lockable& lockable) const {
+ synchro::lockable::lock(lockable);
+ }
+ };
+ }
+
+ namespace detail
+ {
+ template<typename MutexType1,typename MutexType2>
+ unsigned lock_helper(MutexType1& m1,MutexType2& m2) {
+ unique_locker<MutexType1> l1(m1);
+ if(!lockable::try_lock(m2))
+ {
+ return 1;
+ }
+ l1.release();
+ return 0;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3>
+ unsigned lock_helper(MutexType1& m1,MutexType2& m2,MutexType3& m3) {
+ unique_locker<MutexType1> l1(m1);
+ if(unsigned const failed_lock=try_lock_internal(m2,m3))
+ {
+ return failed_lock;
+ }
+ l1.release();
+ return 0;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4>
+ unsigned lock_helper(MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4) {
+ unique_locker<MutexType1> l1(m1);
+ if(unsigned const failed_lock=try_lock_internal(m2,m3,m4))
+ {
+ return failed_lock;
+ }
+ l1.release();
+ return 0;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4,typename MutexType5>
+ unsigned lock_helper(MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4,MutexType5& m5) {
+ unique_locker<MutexType1> l1(m1);
+ if(unsigned const failed_lock=try_lock_internal(m2,m3,m4,m5))
+ {
+ return failed_lock;
+ }
+ l1.release();
+ return 0;
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ void lock_impl(MutexType1& m1,MutexType2& m2,is_mutex_type_wrapper<true>)
+ {
+ unsigned const lock_count=2;
+ unsigned lock_first=0;
+ while(true)
+ {
+ switch(lock_first)
+ {
+ case 0:
+ lock_first=detail::lock_helper(m1,m2);
+ if(!lock_first)
+ return;
+ break;
+ case 1:
+ lock_first=detail::lock_helper(m2,m1);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+1)%lock_count;
+ break;
+ }
+ }
+ }
+
+ template<typename Iterator>
+ void lock_impl(Iterator begin,Iterator end,is_mutex_type_wrapper<false>);
+
+ template<typename Sequence>
+ void lock_seq_impl(Sequence& seq);
+ }
+
+#if 0
+ template <typename Sequence>
+ typename boost::enable_if<fusion::traits::is_sequence<Sequence>,void>::type
+ lock(Sequence& seq) {
+ lock_seq_impl(seq);
+ }
+#endif
+ template<typename MutexType1,typename MutexType2>
+ void lock(MutexType1& m1,MutexType2& m2) {
+ detail::lock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ void lock(const MutexType1& m1,MutexType2& m2) {
+ detail::lock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ void lock(MutexType1& m1,const MutexType2& m2) {
+ detail::lock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ void lock(const MutexType1& m1,const MutexType2& m2) {
+ detail::lock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3>
+ void lock(MutexType1& m1,MutexType2& m2,MutexType3& m3) {
+ unsigned const lock_count=3;
+ unsigned lock_first=0;
+ while(true)
+ {
+ switch(lock_first)
+ {
+ case 0:
+ lock_first=detail::lock_helper(m1,m2,m3);
+ if(!lock_first)
+ return;
+ break;
+ case 1:
+ lock_first=detail::lock_helper(m2,m3,m1);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+1)%lock_count;
+ break;
+ case 2:
+ lock_first=detail::lock_helper(m3,m1,m2);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+2)%lock_count;
+ break;
+ }
+ }
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4>
+ void lock(MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4) {
+ unsigned const lock_count=4;
+ unsigned lock_first=0;
+ while(true)
+ {
+ switch(lock_first)
+ {
+ case 0:
+ lock_first=detail::lock_helper(m1,m2,m3,m4);
+ if(!lock_first)
+ return;
+ break;
+ case 1:
+ lock_first=detail::lock_helper(m2,m3,m4,m1);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+1)%lock_count;
+ break;
+ case 2:
+ lock_first=detail::lock_helper(m3,m4,m1,m2);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+2)%lock_count;
+ break;
+ case 3:
+ lock_first=detail::lock_helper(m4,m1,m2,m3);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+3)%lock_count;
+ break;
+ }
+ }
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4,typename MutexType5>
+ void lock(MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4,MutexType5& m5) {
+ unsigned const lock_count=5;
+ unsigned lock_first=0;
+ while(true)
+ {
+ switch(lock_first)
+ {
+ case 0:
+ lock_first=detail::lock_helper(m1,m2,m3,m4,m5);
+ if(!lock_first)
+ return;
+ break;
+ case 1:
+ lock_first=detail::lock_helper(m2,m3,m4,m5,m1);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+1)%lock_count;
+ break;
+ case 2:
+ lock_first=detail::lock_helper(m3,m4,m5,m1,m2);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+2)%lock_count;
+ break;
+ case 3:
+ lock_first=detail::lock_helper(m4,m5,m1,m2,m3);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+3)%lock_count;
+ break;
+ case 4:
+ lock_first=detail::lock_helper(m5,m1,m2,m3,m4);
+ if(!lock_first)
+ return;
+ lock_first=(lock_first+4)%lock_count;
+ break;
+ }
+ }
+ }
+
+ namespace detail {
+ template<typename Iterator>
+ struct range_lock_guard
+ {
+ Iterator begin;
+ Iterator end;
+
+ range_lock_guard(Iterator begin_,Iterator end_):
+ begin(begin_),end(end_)
+ {
+ lockables::lock(begin,end);
+ }
+
+ void release()
+ {
+ begin=end;
+ }
+
+ ~range_lock_guard()
+ {
+ for(;begin!=end;++begin)
+ {
+ lockable::unlock(*begin);
+ }
+ }
+ };
+ }
+
+
+ namespace detail
+ {
+ template<typename Iterator>
+ void lock_impl(Iterator begin,Iterator end,is_mutex_type_wrapper<false>) {
+ typedef typename std::iterator_traits<Iterator>::value_type lock_type;
+
+ if(begin==end)
+ {
+ return;
+ }
+ bool start_with_begin=true;
+ Iterator second=begin;
+ ++second;
+ Iterator next=second;
+
+ for(;;)
+ {
+ unique_locker<lock_type> begin_lock(*begin,defer_lock);
+ if(start_with_begin)
+ {
+ begin_lock.lock();
+ Iterator const failed_lock=lockables::try_lock(next,end);
+ if(failed_lock==end)
+ {
+ begin_lock.release();
+ return;
+ }
+ start_with_begin=false;
+ next=failed_lock;
+ }
+ else
+ {
+ range_lock_guard<Iterator> guard(next,end);
+ if(begin_lock.try_lock())
+ {
+ Iterator const failed_lock=lockables::try_lock(second,next);
+ if(failed_lock==next)
+ {
+ begin_lock.release();
+ guard.release();
+ return;
+ }
+ start_with_begin=false;
+ next=failed_lock;
+ }
+ else
+ {
+ start_with_begin=true;
+ next=second;
+ }
+ }
+ }
+ }
+ #if 0
+ template<typename Sequence>
+ void lock_seq_impl(Sequence& seq) {
+ typedef typename std::iterator_traits<Iterator>::value_type lock_type;
+
+ if(begin==end)
+ {
+ return;
+ }
+ bool start_with_begin=true;
+ Iterator second=begin;
+ ++second;
+ Iterator next=second;
+
+ for(;;)
+ {
+ unique_locker<lock_type> begin_lock(*begin,defer_lock);
+ if(start_with_begin)
+ {
+ begin_lock.lock();
+ Iterator const failed_lock=lockables::try_lock(next,end);
+ if(failed_lock==end)
+ {
+ begin_lock.release();
+ return;
+ }
+ start_with_begin=false;
+ next=failed_lock;
+ }
+ else
+ {
+ range_lock_guard<Iterator> guard(next,end);
+ if(begin_lock.try_lock())
+ {
+ Iterator const failed_lock=lockables::try_lock(second,next);
+ if(failed_lock==next)
+ {
+ begin_lock.release();
+ guard.release();
+ return;
+ }
+ start_with_begin=false;
+ next=failed_lock;
+ }
+ else
+ {
+ start_with_begin=true;
+ next=second;
+ }
+ }
+ }
+ }
+ #endif
+ }
+
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/lock_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/lock_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,71 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_LOCK_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLES_LOCK_FOR__HPP
+
+#include <algorithm>
+#include <iterator>
+
+#include <boost/thread/locks.hpp>
+#include <boost/synchro/lockables/lock_until.hpp>
+#include <boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp>
+#include <boost/synchro/is_lockable.hpp>
+#include <boost/synchro/lockers.hpp>
+#include <boost/chrono/chrono.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+
+
+ template<typename MutexType1,typename MutexType2, class Rep, class Period >
+ void lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,MutexType2& m2)
+ {
+ detail::lock_until_impl(chrono::monotonic_clock::now()+rel_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Rep, class Period >
+ void lock_for(const chrono::duration<Rep, Period>& rel_time, const MutexType1& m1,MutexType2& m2)
+ {
+ detail::lock_until_impl(chrono::monotonic_clock::now()+rel_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Rep, class Period >
+ void lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,const MutexType2& m2)
+ {
+ detail::lock_until_impl(chrono::monotonic_clock::now()+rel_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Rep, class Period >
+ void lock_for(const chrono::duration<Rep, Period>& rel_time, const MutexType1& m1,const MutexType2& m2)
+ {
+ detail::lock_until_impl(chrono::monotonic_clock::now()+rel_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3, class Rep, class Period >
+ void lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,MutexType2& m2,MutexType3& m3)
+ {
+ detail::lock_until_internal(chrono::monotonic_clock::now()+rel_time,m1,m2,m3);
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4, class Rep, class Period >
+ void lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4)
+ {
+ detail::lock_until_internal(chrono::monotonic_clock::now()+rel_time,m1,m2,m3,m4);
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4,typename MutexType5, class Rep, class Period >
+ void lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4,MutexType5& m5)
+ {
+ detail::lock_until_internal(chrono::monotonic_clock::now()+rel_time,m1,m2,m3,m4,m5);
+ }
+
+
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/lock_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/lock_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,99 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_LOCK_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLES_LOCK_UNTIL__HPP
+
+#include <algorithm>
+#include <iterator>
+
+#include <boost/thread/locks.hpp>
+#include <boost/synchro/lockables/detail/lock_until_internal.hpp>
+#include <boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp>
+#include <boost/synchro/is_lockable.hpp>
+#include <boost/synchro/lockers.hpp>
+#include <boost/chrono/chrono.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+
+ namespace detail
+ {
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ void lock_until_impl(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,is_mutex_type_wrapper<true>)
+ {
+ lock_until_internal(abs_time,m1,m2);
+ }
+
+ template<typename Iterator, class Clock, class Duration >
+ void lock_until_impl(const chrono::time_point<Clock, Duration>& abs_time, Iterator begin,Iterator end,is_mutex_type_wrapper<false>);
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2)
+ {
+ detail::lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, const MutexType1& m1,MutexType2& m2)
+ {
+ detail::lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,const MutexType2& m2)
+ {
+ detail::lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, const MutexType1& m1,const MutexType2& m2)
+ {
+ detail::lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3)
+ {
+ detail::lock_until_internal(abs_time,m1,m2,m3);
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4)
+ {
+ detail::lock_until_internal(abs_time,m1,m2,m3,m4);
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4,typename MutexType5, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4,MutexType5& m5)
+ {
+ detail::lock_until_internal(abs_time,m1,m2,m3,m4,m5);
+ }
+
+
+ namespace detail {
+
+ template<typename Iterator, class Clock, class Duration >
+ void lock_until_impl(const chrono::time_point<Clock, Duration>& abs_time, Iterator begin,Iterator end,is_mutex_type_wrapper<false>)
+
+ {
+ if(begin==end) {
+ return;
+ }
+ typedef typename std::iterator_traits<Iterator>::value_type lock_type;
+ unique_locker<lock_type> guard(abs_time,*begin);
+ lock_until(abs_time,++begin,end);
+ guard.release();
+ }
+ }
+
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/try_lock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/try_lock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,137 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_HPP
+#define BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_HPP
+
+#include <algorithm>
+#include <iterator>
+
+#include <boost/thread/locks.hpp>
+#include <boost/synchro/lockables/detail/try_lock_internal.hpp>
+#include <boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp>
+#include <boost/synchro/is_lockable.hpp>
+#include <boost/synchro/lockers.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+
+ namespace fct {
+ struct try_lock {
+ typedef bool result_type;
+ template<typename Lockable>
+ void operator()(Lockable& lockable) const {
+ synchro::lockable::try_lock(lockable);
+ }
+ };
+ }
+
+ namespace result_of {
+ namespace detail {
+ template<typename Mutex,bool x=is_mutex_type<Mutex>::value>
+ struct try_lock_impl {
+ typedef int type;
+ };
+
+ template<typename Iterator>
+ struct try_lock_impl<Iterator,false> {
+ typedef Iterator type;
+ };
+ }
+ template<typename T>
+ struct try_lock {
+ typedef typename result_of::detail::try_lock_impl<T, is_mutex_type<T>::value>::type type;
+ };
+ }
+
+ namespace detail
+ {
+
+ template<typename MutexType1,typename MutexType2>
+ int try_lock_impl(MutexType1& m1,MutexType2& m2,is_mutex_type_wrapper<true>)
+ {
+ return ((int)detail::try_lock_internal(m1,m2))-1;
+ }
+
+ template<typename Iterator>
+ Iterator try_lock_impl(Iterator begin,Iterator end,is_mutex_type_wrapper<false>);
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ typename result_of::try_lock<MutexType1>::type try_lock(MutexType1& m1,MutexType2& m2)
+ {
+ return detail::try_lock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ typename result_of::try_lock<MutexType1>::type try_lock(const MutexType1& m1,MutexType2& m2)
+ {
+ return detail::try_lock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ typename result_of::try_lock<MutexType1>::type try_lock(MutexType1& m1,const MutexType2& m2)
+ {
+ return detail::try_lock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ typename result_of::try_lock<MutexType1>::type try_lock(const MutexType1& m1,const MutexType2& m2)
+ {
+ return detail::try_lock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3>
+ int try_lock(MutexType1& m1,MutexType2& m2,MutexType3& m3)
+ {
+ return ((int)detail::try_lock_internal(m1,m2,m3))-1;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4>
+ int try_lock(MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4)
+ {
+ return ((int)detail::try_lock_internal(m1,m2,m3,m4))-1;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4,typename MutexType5>
+ int try_lock(MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4,MutexType5& m5)
+ {
+ return ((int)detail::try_lock_internal(m1,m2,m3,m4,m5))-1;
+ }
+
+
+ namespace detail {
+
+ template<typename Iterator>
+ Iterator try_lock_impl(Iterator begin,Iterator end,is_mutex_type_wrapper<false>)
+
+ {
+ if(begin==end)
+ {
+ return end;
+ }
+ typedef typename std::iterator_traits<Iterator>::value_type lock_type;
+ unique_locker<lock_type> guard(*begin,try_to_lock);
+
+ if(!guard.owns_lock())
+ {
+ return begin;
+ }
+ Iterator const failed=lockables::try_lock(++begin,end);
+ if(failed==end)
+ {
+ guard.release();
+ }
+
+ return failed;
+ }
+ }
+
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/try_lock_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/try_lock_for.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,66 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_FOR__HPP
+
+#include <algorithm>
+#include <iterator>
+
+#include <boost/thread/locks.hpp>
+#include <boost/synchro/lockables/try_lock_until.hpp>
+#include <boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+
+ template<typename MutexType1,typename MutexType2, class Rep, class Period >
+ typename result_of::try_lock_until<MutexType1>::type try_lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,MutexType2& m2)
+ {
+ return detail::try_lock_until_impl(chrono::monotonic_clock::now()+rel_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Rep, class Period >
+ typename result_of::try_lock_until<MutexType1>::type try_lock_for(const chrono::duration<Rep, Period>& rel_time, const MutexType1& m1,MutexType2& m2)
+ {
+ return detail::try_lock_until_impl(chrono::monotonic_clock::now()+rel_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Rep, class Period >
+ typename result_of::try_lock_until<MutexType1>::type try_lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,const MutexType2& m2)
+ {
+ return detail::try_lock_until_impl(chrono::monotonic_clock::now()+rel_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Rep, class Period >
+ typename result_of::try_lock_until<MutexType1>::type try_lock_for(const chrono::duration<Rep, Period>& rel_time, const MutexType1& m1,const MutexType2& m2)
+ {
+ return detail::try_lock_until_impl(chrono::monotonic_clock::now()+rel_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3, class Rep, class Period >
+ int try_lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,MutexType2& m2,MutexType3& m3)
+ {
+ return ((int)detail::try_lock_until_internal(chrono::monotonic_clock::now()+rel_time,m1,m2,m3))-1;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4, class Rep, class Period >
+ int try_lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4)
+ {
+ return ((int)detail::try_lock_until_internal(chrono::monotonic_clock::now()+rel_time,m1,m2,m3,m4))-1;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4,typename MutexType5, class Rep, class Period >
+ int try_lock_for(const chrono::duration<Rep, Period>& rel_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4,MutexType5& m5)
+ {
+ return ((int)detail::try_lock_until_internal(chrono::monotonic_clock::now()+rel_time,m1,m2,m3,m4,m5))-1;
+ }
+
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/try_lock_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/try_lock_until.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,126 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_UNTIL__HPP
+
+#include <algorithm>
+#include <iterator>
+
+#include <boost/thread/locks.hpp>
+#include <boost/synchro/lockables/detail/try_lock_until_internal.hpp>
+#include <boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+
+
+ namespace result_of {
+ namespace detail {
+ template<typename Mutex,bool x=is_mutex_type<Mutex>::value>
+ struct try_lock_until_impl {
+ typedef int type;
+ };
+
+ template<typename Iterator>
+ struct try_lock_until_impl<Iterator,false> {
+ typedef Iterator type;
+ };
+ }
+ template<typename T>
+ struct try_lock_until {
+ typedef typename result_of::detail::try_lock_until_impl<T, is_mutex_type<T>::value>::type type;
+ };
+ }
+
+ namespace detail
+ {
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ int try_lock_until_impl(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,is_mutex_type_wrapper<true>)
+ {
+ return ((int)detail::lock_until_internal(abs_time,m1,m2))-1;
+ }
+
+ template<typename Iterator, class Clock, class Duration >
+ Iterator try_lock_until_impl(const chrono::time_point<Clock, Duration>& abs_time, Iterator begin,Iterator end,is_mutex_type_wrapper<false>);
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ typename result_of::try_lock_until<MutexType1>::type try_lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2)
+ {
+ return detail::try_lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ typename result_of::try_lock_until<MutexType1>::type try_lock_until(const chrono::time_point<Clock, Duration>& abs_time, const MutexType1& m1,MutexType2& m2)
+ {
+ return detail::try_lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ typename result_of::try_lock_until<MutexType1>::type try_lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,const MutexType2& m2)
+ {
+ return detail::try_lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ typename result_of::try_lock_until<MutexType1>::type try_lock_until(const chrono::time_point<Clock, Duration>& abs_time, const MutexType1& m1,const MutexType2& m2)
+ {
+ return detail::try_lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3, class Clock, class Duration >
+ int try_lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3)
+ {
+ return ((int)detail::try_lock_until_internal(abs_time,m1,m2,m3))-1;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4, class Clock, class Duration >
+ int try_lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4)
+ {
+ return ((int)detail::try_lock_until_internal(abs_time,m1,m2,m3,m4))-1;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4,typename MutexType5, class Clock, class Duration >
+ int try_lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4,MutexType5& m5)
+ {
+ return ((int)detail::try_lock_until_internal(abs_time,m1,m2,m3,m4,m5))-1;
+ }
+
+
+ namespace detail {
+
+ template<typename Iterator, class Clock, class Duration >
+ Iterator try_lock_until_impl(const chrono::time_point<Clock, Duration>& abs_time, Iterator begin,Iterator end,is_mutex_type_wrapper<false>)
+
+ {
+ if(begin==end)
+ {
+ return end;
+ }
+ typedef typename std::iterator_traits<Iterator>::value_type lock_type;
+ unique_lock<lock_type> guard(*begin,abs_time);
+
+ if(!guard.owns_lock())
+ {
+ return begin;
+ }
+ Iterator const failed=try_lock_until(abs_time,++begin,end);
+ if(failed==end)
+ {
+ guard.release();
+ }
+
+ return failed;
+ }
+ }
+
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/try_lock_until3.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/try_lock_until3.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,108 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLES_TRY_LOCK_UNTIL__HPP
+
+#include <algorithm>
+#include <iterator>
+
+#include <boost/thread/locks.hpp>
+#include <boost/synchro/lockables/detail/try_lock_until_internal.hpp>
+#include <boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp>
+#include <boost/synchro/lockers.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+
+ namespace detail
+ {
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ int lock_until_impl(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,is_mutex_type_wrapper<true>)
+ {
+ return ((int)detail::lock_until_internal(abs_time,m1,m2))-1;
+ }
+
+ template<typename Iterator, class Clock, class Duration >
+ Iterator lock_until_impl(const chrono::time_point<Clock, Duration>& abs_time, Iterator begin,Iterator end,is_mutex_type_wrapper<false>);
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2)
+ {
+ return detail::lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, const MutexType1& m1,MutexType2& m2)
+ {
+ return detail::lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,const MutexType2& m2)
+ {
+ return detail::lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, const MutexType1& m1,const MutexType2& m2)
+ {
+ return detail::lock_until_impl(abs_time,m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3)
+ {
+ return ((int)detail::lock_until_internal(abs_time,m1,m2,m3))-1;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4)
+ {
+ return ((int)detail::lock_until_internal(abs_time,m1,m2,m3,m4))-1;
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,typename MutexType4,typename MutexType5, class Clock, class Duration >
+ void lock_until(const chrono::time_point<Clock, Duration>& abs_time, MutexType1& m1,MutexType2& m2,MutexType3& m3,MutexType4& m4,MutexType5& m5)
+ {
+ return ((int)detail::lock_until_internal(abs_time,m1,m2,m3,m4,m5))-1;
+ }
+
+
+ namespace detail {
+
+ template<typename Iterator, class Clock, class Duration >
+ Iterator lock_until_impl(const chrono::time_point<Clock, Duration>& abs_time, Iterator begin,Iterator end,is_mutex_type_wrapper<false>)
+
+ {
+ if(begin==end)
+ {
+ return end;
+ }
+ typedef typename std::iterator_traits<Iterator>::value_type lock_type;
+ unique_lock<lock_type> guard(*begin,abs_time);
+
+ if(!guard.owns_lock())
+ {
+ return begin;
+ }
+ Iterator const failed=lock_until(abs_time,++begin,end);
+ if(failed==end)
+ {
+ guard.release();
+ }
+
+ return failed;
+ }
+ }
+
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockables/unlock.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockables/unlock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,123 @@
+// 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)
+// (C) Copyright 2007 Anthony Williams
+
+#ifndef BOOST_SYNCHRO_LOCKABLES_UNLOCK_HPP
+#define BOOST_SYNCHRO_LOCKABLES_UNLOCK_HPP
+
+#include <algorithm>
+#include <iterator>
+
+#include <boost/thread/locks.hpp>
+#include <boost/synchro/lockables/detail/try_lock_internal.hpp>
+#include <boost/synchro/lockables/detail/is_mutex_type_wrapper.hpp>
+#include <boost/synchro/lockables/try_lock.hpp>
+#include <boost/synchro/lockable/try_lock.hpp>
+#include <boost/synchro/lockable/unlock.hpp>
+#include <boost/synchro/is_lockable.hpp>
+#include <boost/synchro/lockers.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/fusion/include/for_each.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockables {
+
+ namespace fct {
+ struct unlock {
+ typedef void result_type;
+ template<typename Lockable>
+ void operator()(Lockable& lockable) const {
+ synchro::lockable::unlock(lockable);
+ }
+ };
+ }
+
+ namespace detail
+ {
+
+ template<typename MutexType1,typename MutexType2>
+ void unlock_impl(MutexType1& m1,MutexType2& m2,is_mutex_type_wrapper<true>)
+ {
+ lockable::unlock(m1);
+ lockable::unlock(m2);
+ }
+
+ template<typename Iterator>
+ void unlock_impl(Iterator begin,Iterator end,is_mutex_type_wrapper<false>);
+ }
+
+ template <typename Sequence>
+ typename boost::enable_if<fusion::traits::is_sequence<Sequence>,void>::type
+ unlock(Sequence& t) {
+ fusion::for_each(t, fct::unlock());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ void unlock(MutexType1& m1,MutexType2& m2) {
+ detail::unlock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ void unlock(const MutexType1& m1,MutexType2& m2) {
+ detail::unlock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ void unlock(MutexType1& m1,const MutexType2& m2) {
+ detail::unlock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2>
+ void unlock(const MutexType1& m1,const MutexType2& m2) {
+ detail::unlock_impl(m1,m2,detail::is_mutex_type_wrapper<is_mutex_type<MutexType1>::value>());
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3>
+ void unlock(MutexType1& m1,MutexType2& m2,MutexType3& m3) {
+ lockable::unlock(m1);
+ lockable::unlock(m2);
+ lockable::unlock(m3);
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4>
+ void unlock(MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4) {
+ lockable::unlock(m1);
+ lockable::unlock(m2);
+ lockable::unlock(m3);
+ lockable::unlock(m4);
+ }
+
+ template<typename MutexType1,typename MutexType2,typename MutexType3,
+ typename MutexType4,typename MutexType5>
+ void unlock(MutexType1& m1,MutexType2& m2,MutexType3& m3,
+ MutexType4& m4,MutexType5& m5) {
+ lockable::unlock(m1);
+ lockable::unlock(m2);
+ lockable::unlock(m3);
+ lockable::unlock(m4);
+ lockable::unlock(m5);
+ }
+
+ namespace detail
+ {
+ template<typename Iterator>
+ void unlock_impl(Iterator begin,Iterator end,is_mutex_type_wrapper<false>) {
+ typedef typename std::iterator_traits<Iterator>::value_type lock_type;
+
+ for(Iterator it=begin; it!=end; ++it)
+ {
+ lockable::unlock(*it);
+ }
+ }
+ }
+
+}}}
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockers/array_locker.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockers/array_locker.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -0,0 +1,443 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/synchro for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_SYNCHRO_ARRAY_LOCKER__HPP
+#define BOOST_SYNCHRO_ARRAY_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/lockable/functions.hpp>
+#include <boost/synchro/lockables/functions.hpp>
+#include <boost/synchro/lockers.hpp>
+#include <boost/synchro/thread/locks.hpp>
+#include <boost/chrono/chrono.hpp>
+
+namespace boost { namespace synchro {
+
+/*
+ *
+ * {
+ * unique_array_locker<shared_lock<mutex>, 3> lock(m1, m2, m3);
+ * // ... some code needing lock on m1, m2, m3
+ * }
+ */
+
+ template <typename Lockable, unsigned N>
+ class unique_array_locker;
+
+ template <typename Lockable>
+ class unique_array_locker<Lockable,2> {
+ public:
+ typedef Lockable lockable_type;
+ BOOST_NON_CONST_COPY_CONSTRUCTOR_DELETE(unique_array_locker) /*< disable copy construction >*/
+ BOOST_NON_CONST_COPY_ASSIGNEMENT_DELETE(unique_array_locker) /*< disable copy asignement >*/
+
+ inline unique_array_locker(Lockable& m0, Lockable& m1)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(false)
+ {
+ lock();
+ }
+ inline unique_array_locker(Lockable& m0, Lockable& m1, adopt_lock_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(true)
+ {}
+ inline unique_array_locker(Lockable& m0, Lockable& m1, defer_lock_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(false)
+ {}
+ inline unique_array_locker(Lockable& m0, Lockable& m1, try_to_lock_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(lockables::try_lock(mtx0_,mtx1_)==-1)
+ {}
+ ~unique_array_locker() {
+ if (locked_) unlock();
+ }
+
+ template<class Clock, class Duration >
+ unique_array_locker(Lockable& m0, Lockable& m1, chrono::time_point<Clock, Duration> const& target_time)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(lockables::try_lock_until(target_time,mtx0_,mtx1_)==-1)
+ {}
+ template<class Rep, class Period >
+ unique_array_locker(Lockable& m0, Lockable& m1, chrono::duration<Rep, Period> const& target_time)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(lockables::try_lock_for(target_time,mtx0_,mtx1_)==-1)
+ {}
+
+ template<class Clock, class Duration >
+ unique_array_locker(Lockable& m0, Lockable& m1, chrono::time_point<Clock, Duration> const& target_time, throw_timeout_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(false)
+ {
+ lock_until(target_time);
+ }
+ template<class Rep, class Period >
+ unique_array_locker(Lockable& m0, Lockable& m1, chrono::duration<Rep, Period> const& target_time, throw_timeout_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(false)
+ {
+ lock_until(target_time);
+ }
+
+ template<class Clock, class Duration >
+ unique_array_locker(chrono::time_point<Clock, Duration> const& target_time, Lockable& m0, Lockable& m1)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(false)
+ {
+ lock_until(target_time);
+ }
+ template<class Rep, class Period >
+ unique_array_locker(chrono::duration<Rep, Period> const& target_time, Lockable& m0, Lockable& m1)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(false)
+ {
+ lock_for(target_time);
+ }
+
+ template<class Clock, class Duration >
+ unique_array_locker(nothrow_timeout_t, Lockable& m0, Lockable& m1, chrono::time_point<Clock, Duration> const& target_time)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(lockables::try_lock_until(target_time,mtx0_,mtx1_)==-1)
+ {
+ }
+ template<class Rep, class Period >
+ unique_array_locker(nothrow_timeout_t, Lockable& m0, Lockable& m1, chrono::duration<Rep, Period> const& target_time)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(lockables::try_lock_for(target_time,mtx0_,mtx1_)==-1)
+ {
+ }
+ bool is_locking(lockable_type* l) const {
+ return locked_&& ((mtx0_==l)|| (mtx1_==l));
+ }
+ bool owns_lock() const {
+ return locked_;
+ }
+ typedef bool (unique_array_locker::*bool_type)() const; /*< safe bool idiom >*/
+ operator bool_type() const { return (owns_lock()?&unique_array_locker::owns_lock:0); }
+ bool operator!() const { return !owns_lock(); }
+
+ void lock() {
+ lockables::lock(mtx0_,mtx1_);
+ locked_=true;
+ }
+
+ void unlock() {
+ lockable::unlock(mtx0_);
+ lockable::unlock(mtx1_);
+ locked_=false;
+ }
+ bool try_lock()
+ {
+ locked_=(lockables::try_lock(mtx0_,mtx1_)==-1);
+ return locked_;
+ }
+ template<class Rep, class Period >
+ bool try_lock_for(chrono::duration<Rep, Period> const& relative_time)
+ {
+ locked_=(lockables::try_lock_for(relative_time,mtx0_,mtx1_)==-1);
+ return locked_;
+ }
+
+ template<class Clock, class Duration >
+ bool try_lock_until(chrono::time_point<Clock, Duration> const& absolute_time)
+ {
+ locked_=(lockables::try_lock_until(absolute_time,mtx0_,mtx1_)==-1);
+ return locked_;
+ }
+
+ template<class Rep, class Period >
+ void lock_for(chrono::duration<Rep, Period> const& relative_time)
+ {
+ if(!try_lock_for(relative_time)) throw timeout_exception();
+ }
+
+ template<class Clock, class Duration >
+ void lock_until(chrono::time_point<Clock, Duration> const& absolute_time)
+ {
+ if(!try_lock_until(absolute_time)) throw timeout_exception();
+ }
+
+ protected:
+ lockable_type& mtx0_;
+ lockable_type& mtx1_;
+ bool locked_;
+ };
+
+ template <typename Lockable>
+ class unique_array_locker<Lockable,3> {
+ public:
+ typedef Lockable lockable_type;
+ BOOST_NON_CONST_COPY_CONSTRUCTOR_DELETE(unique_array_locker) /*< disable copy construction >*/
+ BOOST_NON_CONST_COPY_ASSIGNEMENT_DELETE(unique_array_locker) /*< disable copy asignement >*/
+
+ inline unique_array_locker(Lockable& m0, Lockable& m1, Lockable& m2)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(false)
+ {
+ lock();
+ }
+ inline unique_array_locker(Lockable& m0, Lockable& m1, Lockable& m2, adopt_lock_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(true)
+ {}
+ inline unique_array_locker(Lockable& m0, Lockable& m1, Lockable& m2, defer_lock_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(false)
+ {}
+ inline unique_array_locker(Lockable& m0, Lockable& m1, Lockable& m2, try_to_lock_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(lockables::try_lock(mtx0_,mtx1_,mtx2_)==-1)
+ {}
+ ~unique_array_locker() {
+ if (locked_) unlock();
+ }
+
+ template<class Clock, class Duration >
+ unique_array_locker(Lockable& m0, Lockable& m1, Lockable& m2, chrono::time_point<Clock, Duration> const& target_time)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(lockables::try_lock_until(target_time,mtx0_,mtx1_,mtx2_)==-1)
+ {}
+ template<class Rep, class Period >
+ unique_array_locker(Lockable& m0, Lockable& m1, Lockable& m2, chrono::duration<Rep, Period> const& target_time)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(lockables::try_lock_for(target_time,mtx0_,mtx1_,mtx2_)==-1)
+ {}
+
+ template<class Clock, class Duration >
+ unique_array_locker(Lockable& m0, Lockable& m1, Lockable& m2, chrono::time_point<Clock, Duration> const& target_time, throw_timeout_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(false)
+ {
+ lock_until(target_time);
+ }
+ template<class Rep, class Period >
+ unique_array_locker(Lockable& m0, Lockable& m1, Lockable& m2, chrono::duration<Rep, Period> const& target_time, throw_timeout_t)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(false)
+ {
+ lock_until(target_time);
+ }
+
+ template<class Clock, class Duration >
+ unique_array_locker(nothrow_timeout_t, Lockable& m0, Lockable& m1, Lockable& m2, chrono::time_point<Clock, Duration> const& target_time)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(lockables::try_lock_until(target_time,mtx0_,mtx1_,mtx2_)==-1)
+ {
+ }
+ template<class Rep, class Period >
+ unique_array_locker(nothrow_timeout_t, Lockable& m0, Lockable& m1, Lockable& m2, chrono::duration<Rep, Period> const& target_time)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(lockables::try_lock_for(target_time,mtx0_,mtx1_,mtx2_)==-1)
+ {
+ }
+
+ template<class Clock, class Duration >
+ unique_array_locker(chrono::time_point<Clock, Duration> const& target_time, Lockable& m0, Lockable& m1, Lockable& m2)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(false)
+ {
+ lock_until(target_time);
+ }
+ template<class Rep, class Period >
+ unique_array_locker(chrono::duration<Rep, Period> const& target_time, Lockable& m0, Lockable& m1, Lockable& m2)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(false)
+ {
+ lock_for(target_time);
+ }
+
+ bool is_locking(lockable_type* l) const {
+ return locked_&& ((mtx0_==l)|| (mtx1_==l)|| (mtx2_==l));
+ }
+ bool owns_lock() const {
+ return locked_;
+ }
+
+
+ typedef bool (unique_array_locker::*bool_type)() const; /*< safe bool idiom >*/
+ operator bool_type() const { return (owns_lock()?&strict_locker::owns_lock:0; }
+ bool operator!() const { return !owns_lock(); }
+
+ void lock() {
+ lockables::lock(mtx0_,mtx1_,mtx2_);
+ locked_=true;
+ }
+
+ void unlock() {
+ lockable::unlock(mtx0_);
+ lockable::unlock(mtx1_);
+ lockable::unlock(mtx2_);
+ locked_=false;
+ }
+ bool try_lock()
+ {
+ locked_=(lockables::try_lock(mtx0_,mtx1_,mtx2_)==-1);
+ return locked_;
+ }
+ template<class Rep, class Period >
+ bool try_lock_for(chrono::duration<Rep, Period> const& relative_time)
+ {
+ locked_=(lockables::try_lock_for(relative_time,mtx0_,mtx1_,mtx2_)==-1);
+ return locked_;
+ }
+
+ template<class Clock, class Duration >
+ bool try_lock_until(chrono::time_point<Clock, Duration> const& absolute_time)
+ {
+ locked_=(lockables::try_lock_until(absolute_time,mtx0_,mtx1_,mtx2_)==-1);
+ return locked_;
+ }
+
+ template<class Rep, class Period >
+ void lock_for(chrono::duration<Rep, Period> const& relative_time)
+ {
+ if(!try_lock_for(relative_time)) throw timeout_exception();
+ }
+
+ template<class Clock, class Duration >
+ void lock_until(chrono::time_point<Clock, Duration> const& absolute_time)
+ {
+ if(!try_lock_until(absolute_time)) throw timeout_exception();
+ }
+
+ protected:
+ lockable_type& mtx0_;
+ lockable_type& mtx1_;
+ lockable_type& mtx2_;
+ bool locked_;
+ };
+
+#if 0
+ template <typename Loker, unsigned N>
+ class try_unique_array_locker;
+
+ template <typename Loker, 2>
+ class try_unique_array_locker {
+ public:
+ inline try_array_loker(lockable_type& m0, lockable_type& m1)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , locked_(lockable::try_lock(mtx0_,mtx1_)))
+ {}
+ ~try_unique_array_locker() {
+ unlock();
+ }
+
+ protected:
+ void unlock() {
+ lockable::unlock(mtx0_);
+ lockable::unlock(mtx1_);
+ }
+
+ lockable_type mtx0_;
+ lockable_type mtx1_;
+ };
+
+ template <typename Loker, 3>
+ class try_unique_array_locker {
+ public:
+ inline try_unique_array_locker(lockable_type& m0, lockable_type& m1, lockable_type& m2)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , locked_(lockable::try_lock(mtx0_,mtx1_,mtx2_))
+ {}
+ ~try_unique_array_locker() {
+ unlock();
+ }
+
+ protected:
+ void unlock() {
+ lockable::unlock(mtx0_);
+ lockable::unlock(mtx1_);
+ lockable::unlock(mtx2_);
+ }
+
+ lockable_type mtx0_;
+ lockable_type mtx1_;
+ lockable_type mtx2_;
+ };
+
+ template <typename Loker, 4>
+ class try_unique_array_locker {
+ public:
+ inline try_array_loker(
+ lockable_type& m0
+ , lockable_type& m1
+ , lockable_type& m2
+ , lockable_type& m3)
+ : mtx0_(m0)
+ , mtx1_(m1)
+ , mtx2_(m2)
+ , mtx3_(m2)
+ , locked_(lockable::try_lock(mtx0_,mtx1_,mtx2_,mtx3_))
+ {}
+ ~try_array_loker() {
+ unlock();
+ }
+
+ protected:
+ void unlock() {
+ lockable::unlock(mtx0_);
+ lockable::unlock(mtx1_);
+ lockable::unlock(mtx2_);
+ lockable::unlock(mtx3_);
+ }
+
+ lockable_type mtx0_;
+ lockable_type mtx1_;
+ lockable_type mtx2_;
+ lockable_type mtx3_;
+ };
+#endif
+}
+}
+
+#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-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -15,6 +15,7 @@
 #include <boost/synchro/lockable_traits.hpp>
 #include <boost/thread/thread_time.hpp>
 #include <boost/synchro/detail/deleted_functions.hpp>
+#include <boost/chrono/chrono.hpp>
 
 //!\file
 //!Describes null_mutex classes
@@ -70,6 +71,14 @@
    bool try_lock_for(TimeDuration const & relative_time)
    {return true;}
 
+ template<typename Clock, typename Duration>
+ bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {return true;}
+
+ template<typename Rep, typename Period>
+ bool try_lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {return true;}
+
    //!Simulates a mutex timed_lock() operation.
    //!Equivalent to "return true;"
    bool lock_until(const boost::posix_time::ptime &)
@@ -81,6 +90,13 @@
    bool lock_for(TimeDuration const & relative_time)
    {return true;}
 
+ template<typename Clock, typename Duration>
+ void lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {}
+
+ template<typename Rep, typename Period>
+ void lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {}
 
    //!Simulates a mutex unlock() operation.
    //!Empty function.
@@ -106,6 +122,14 @@
    bool try_lock_shared_for(const TimeDuration &)
    { return true; }
 
+ template<typename Clock, typename Duration>
+ bool try_lock_shared_until(chrono::time_point<Clock, Duration> const & relative_time)
+ {return true;}
+
+ template<typename Rep, typename Period>
+ bool try_lock_shared_for(chrono::duration<Rep, Period> const & relative_time)
+ {return true;}
+
    //!Simulates a mutex lock_shared_until() operation.
    //!Equivalent to "return true;"
    bool lock_shared_until(const boost::posix_time::ptime &)
@@ -117,6 +141,13 @@
    bool lock_shared_for(const TimeDuration &)
    { return true; }
 
+ template<typename Clock, typename Duration>
+ void lock_shared_until(chrono::time_point<Clock, Duration> const & relative_time)
+ {}
+ template<typename Rep, typename Period>
+ void lock_shared_for(chrono::duration<Rep, Period> const & relative_time)
+ {}
+
    //!Simulates a mutex unlock_share() operation.
    //!Empty function.
    void unlock_shared(){}
@@ -135,6 +166,14 @@
    bool try_lock_upgrade_until(boost::posix_time::ptime const &)
    { return true; }
 
+ template<typename Clock, typename Duration>
+ bool try_lock_upgrade_until(chrono::time_point<Clock, Duration> const & relative_time)
+ {return true;}
+
+ template<typename Rep, typename Period>
+ bool try_lock_upgrade_for(chrono::duration<Rep, Period> const & relative_time)
+ {return true;}
+
    //!Simulates a mutex unlock_upgrade() operation.
    //!Empty function.
    void unlock_upgrade(){}
@@ -167,6 +206,14 @@
    bool unlock_upgrade_and_lock_until(const boost::posix_time::ptime &)
    { return true; }
 
+ template<typename Clock, typename Duration>
+ bool unlock_upgrade_and_lock_until(chrono::time_point<Clock, Duration> const & relative_time)
+ {return true;}
+
+ template<typename Rep, typename Period>
+ bool unlock_upgrade_and_lock_for(chrono::duration<Rep, Period> const & relative_time)
+ {return true;}
+
    //!Simulates try_unlock_share_and_lock().
    //!Equivalent to "return true;"
    bool try_unlock_share_and_lock()

Modified: sandbox/synchro/boost/synchro/poly/lock.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/poly/lock.hpp (original)
+++ sandbox/synchro/boost/synchro/poly/lock.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -10,6 +10,8 @@
 
 #ifndef BOOST_SYNCHRO_POLY_LOCK__HPP
 #define BOOST_SYNCHRO_POLY_LOCK__HPP
+#include <boost/chrono/chrono.hpp>
+#include <boost/thread/thread_time.hpp>
 
 namespace boost { namespace synchro { namespace poly {
 
@@ -38,6 +40,10 @@
     {
         return lock_until(get_system_time()+rel_time);
     }
+ virtual bool try_lock_until(chrono::system_clock::time_point const & abs_time)=0;
+ virtual bool try_lock_for(chrono::nanoseconds const & relative_time)=0;
+ virtual void lock_until(chrono::system_clock::time_point const & abs_time)=0;
+ virtual void lock_for(chrono::nanoseconds const & relative_time)=0;
 };
 
 
@@ -60,6 +66,10 @@
         lock_shared_until(get_system_time()+rel_time);
     }
     virtual void unlock_shared()=0;
+ virtual bool try_lock_shared_until(chrono::system_clock::time_point const & abs_time)=0;
+ virtual bool try_lock_shared_for(chrono::nanoseconds const & relative_time)=0;
+ virtual void lock_shared_until(chrono::system_clock::time_point const & abs_time)=0;
+ virtual void lock_shared_for(chrono::nanoseconds const & relative_time)=0;
 };
 
 //////////////////////////////////////////////////////////////////////////////
@@ -72,15 +82,19 @@
     template<typename TimeDuration>
     bool try_lock_upgrade_for(TimeDuration const&t)
     {
- return try_lock_upgrade_for(t);
+ return try_lock_upgrade_until(get_system_time()+t);
     }
     
     virtual void lock_upgrade_until(system_time const&t)=0;
     template<typename TimeDuration>
     void lock_upgrade_for(TimeDuration const&t)
     {
- lock_upgrade_for(t);
+ lock_upgrade_until(get_system_time()+t);
     }
+ virtual bool try_lock_upgrade_until(chrono::system_clock::time_point const & abs_time)=0;
+ virtual bool try_lock_shared_for(chrono::nanoseconds const & relative_time)=0;
+ virtual void lock_upgrade_until(chrono::system_clock::time_point const & abs_time)=0;
+ virtual void lock_shared_for(chrono::nanoseconds const & relative_time)=0;
     
     virtual void unlock_upgrade()=0;
     virtual void unlock_upgrade_and_lock()=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-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -63,6 +63,22 @@
     template<typename DurationType>
     bool lock_for(DurationType const& rel_time)
     {return lock_for(rel_time);}
+
+ template<typename Clock, typename Duration>
+ bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {return the_lock().try_lock_until(abs_time);}
+ template<typename Rep, typename Period>
+ bool try_lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {return the_lock().try_lock_for(rel_time);}
+
+ template<typename Clock, typename Duration>
+ void lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {the_lock().lock_until(abs_time);}
+ template<typename Rep, typename Period>
+ void lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {the_lock().lock_for(rel_time);}
+
+
 private:
     TimeLockable& the_lock() {return *static_cast<TimeLockable*>(&this->lock_);}
 };
@@ -96,6 +112,21 @@
     {the_lock().lock_shared_for(t);}
     void lock_shared_until(system_time const& t)
     {the_lock().lock_shared_until(t);}
+
+ template<typename Clock, typename Duration>
+ bool try_lock_shared_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {return the_lock().try_lock_shared_until(abs_time);}
+ template<typename Rep, typename Period>
+ bool try_lock_shared_for(chrono::duration<Rep, Period> const & rel_time)
+ {return the_lock().try_lock_shared_for(rel_time);}
+
+
+ template<typename Clock, typename Duration>
+ void lock_shared_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {the_lock().lock_shared_until(abs_time);}
+ template<typename Rep, typename Period>
+ void lock_shared_for(chrono::duration<Rep, Period> const & rel_time)
+ {the_lock().lock_shared_for(rel_time);}
     
 private:
     SharableLock& the_lock() {return *static_cast<SharableLock*>(&this->lock_);}
@@ -137,6 +168,20 @@
     void lock_upgrade_for(TimeDuration const&t)
     {the_lock().lock_upgrade_for(t);}
 
+ template<typename Clock, typename Duration>
+ bool try_lock_upgrade_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {return the_lock().try_lock_upgrade_until(abs_time);}
+ template<typename Rep, typename Period>
+ bool try_lock_upgrade_for(chrono::duration<Rep, Period> const & rel_time)
+ {return the_lock().try_lock_upgrade_for(rel_time);}
+
+ template<typename Clock, typename Duration>
+ void lock_upgrade_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {the_lock().lock_upgrade_until(abs_time);}
+ template<typename Rep, typename Period>
+ void lock_upgrade_for(chrono::duration<Rep, Period> const & rel_time)
+ {the_lock().try_lock_upgrade_for(rel_time);}
+
 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-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -77,8 +77,8 @@
     typedef boost::interprocess::upgrade_to_unique_lock<boost::interprocess::interprocess_mutex> type;
 };
 #endif
-#if 0
-typedef boost::interprocess::interprocess_mutex interprocess_mutex;
+#if 1
+//typedef boost::interprocess::interprocess_mutex interprocess_mutex;
 
 template<>
 struct timed_interface_tag<boost::interprocess::interprocess_mutex> {
@@ -118,6 +118,40 @@
 };
 
 #endif
+
+namespace lockable {
+ namespace partial_specialization_workaround {
+ template <class Clock, class Duration >
+ struct lock_until<boost::interprocess::interprocess_mutex,Clock, Duration> {
+ static void
+ apply( boost::interprocess::interprocess_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ if(!lockable.timed_lock(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ }
+ };
+ template <class Rep, class Period >
+ struct lock_for<boost::interprocess::interprocess_mutex,Rep, Period> {
+ static void
+ apply( boost::interprocess::interprocess_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ if(!lockable.timed_lock(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ }
+ };
+ template <class Clock, class Duration >
+ struct try_lock_until<boost::interprocess::interprocess_mutex,Clock, Duration> {
+ static typename result_of::template try_lock_until<boost::interprocess::interprocess_mutex,Clock, Duration>::type
+ apply( boost::interprocess::interprocess_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.timed_lock(boost::convert_to<posix_time::ptime>(abs_time));
+ }
+ };
+ template <class Rep, class Period >
+ struct try_lock_for<boost::interprocess::interprocess_mutex,Rep, Period> {
+ static typename result_of::template try_lock_for<boost::interprocess::interprocess_mutex,Rep, Period>::type
+ apply( boost::interprocess::interprocess_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.timed_lock(boost::convert_to<posix_time::time_duration>(rel_time));
+ }
+ };
+ }
+}
+
 }
 }
 

Modified: sandbox/synchro/boost/synchro/semaphore.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/semaphore.hpp (original)
+++ sandbox/synchro/boost/synchro/semaphore.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -154,10 +154,12 @@
 
     //!Creates a semaphore with the given initial count.
     //!exception if there is an error.*/
- inline explict basic_binary_semaphore(int initialCount):basic_semaphore<ScopeTag>(initialCount>0?1:0) {};
+ inline explicit basic_binary_semaphore(int initialCount)
+ :basic_semaphore<ScopeTag>(initialCount>0?1:0) {};
+
     inline void post()
     {
- scoped_lock lock(this->m_mut);
+ typename basic_semaphore<ScopeTag>::scoped_lock lock(this->m_mut);
         if(this->m_count == 0){
             this->m_cond.notify_one();
             ++(this->m_count);

Modified: sandbox/synchro/boost/synchro/thread/locks.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/thread/locks.hpp (original)
+++ sandbox/synchro/boost/synchro/thread/locks.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -16,7 +16,11 @@
 #include <boost/synchro/lockable_traits.hpp>
 #include <boost/synchro/lockers.hpp>
 #include <boost/synchro/detail/deleted_functions.hpp>
-
+//#include <boost/synchro/thread/thread_to_lockable_adapter.hpp>
+#include <boost/chrono/chrono.hpp>
+#include <boost/convert_to/chrono_time_point_to_posix_time_ptime.hpp>
+#include <boost/convert_to/chrono_duration_to_posix_time_duration.hpp>
+#include <boost/synchro/lockable/functions.hpp>
 
 namespace boost { namespace synchro {
 
@@ -40,12 +44,20 @@
 
 
     template<typename Mutex>
- class unique_locker<Mutex,multi_threaded_tag>: public unique_lock_type<Mutex>::type {
+ class unique_locker<Mutex,multi_threaded_tag>:
+ public unique_lock_type<Mutex >::type
+ {
         //typename scope_tag<Mutex>::type == multi_threaded_tag
     public:
         typedef Mutex lockable_type;
         typedef multi_threaded_tag scope_tag_type;
- typedef typename unique_lock_type<Mutex>::type base_type;
+ typedef typename unique_lock_type<Mutex >::type base_type;
+ typedef typename scope_tag<lockable_type>::type scope;
+ typedef typename category_tag<lockable_type>::type category;
+ typedef typename reentrancy_tag<lockable_type>::type reentrancy;
+ typedef typename timed_interface_tag<lockable_type>::type timed_interface;
+ typedef typename lifetime_tag<lockable_type>::type lifetime;
+ typedef typename naming_tag<lockable_type>::type naming;
 
         BOOST_NON_CONST_COPY_CONSTRUCTOR_DELETE(unique_locker) /*< disable copy construction >*/
         BOOST_NON_CONST_COPY_ASSIGNEMENT_DELETE(unique_locker) /*< disable copy asignement >*/
@@ -66,14 +78,24 @@
         unique_locker(Mutex& m_,TimeDuration const& target_time): base_type(m_, target_time)
         {}
 
+ template <class Clock, class Duration>
+ unique_locker(Mutex& m_, chrono::time_point<Clock, Duration> const& target_time)
+ : base_type(m_, boost::convert_to<posix_time::ptime>(target_time))
+ {}
         unique_locker(nothrow_timeout_t, system_time const& target_time, Mutex& m_)
             : base_type(m_, target_time)
         {}
+
         template<typename TimeDuration>
         unique_locker(nothrow_timeout_t, TimeDuration const& target_time, Mutex& m_)
             : base_type(m_, target_time)
         {}
 
+ template <class Clock, class Duration>
+ unique_locker(nothrow_timeout_t, chrono::time_point<Clock, Duration> const& target_time, Mutex& m_)
+ : base_type(m_, boost::convert_to<posix_time::ptime>(target_time))
+ {}
+
         unique_locker(Mutex& m_,system_time const& target_time, throw_timeout_t)
             : base_type(m_, boost::defer_lock)
         {
@@ -86,6 +108,12 @@
             lock_for(target_time);
         }
 
+ template <class Clock, class Duration>
+ unique_locker(Mutex& m_,chrono::time_point<Clock, Duration> const& target_time, throw_timeout_t)
+ : base_type(m_, boost::defer_lock)
+ {
+ lock_until(target_time);
+ }
 
         template<typename TimeDuration>
         unique_locker(TimeDuration const& target_time, Mutex& m_)
@@ -98,6 +126,12 @@
         {
             lock_until(target_time);
         }
+ template <class Clock, class Duration>
+ unique_locker(chrono::time_point<Clock, Duration> const& target_time, Mutex& m_)
+ : base_type(m_, boost::defer_lock)
+ {
+ lock_until(target_time);
+ }
 #ifdef BOOST_HAS_RVALUE_REFS
         unique_locker(unique_locker&& other): base_type(other)
         {}
@@ -181,7 +215,21 @@
         template<typename TimeDuration>
         bool try_lock_for(TimeDuration const& relative_time)
         {
+ #if 1
             return this->timed_lock(relative_time);
+ #else
+ try_lock_for(*this, relative_time);
+ #endif
+ }
+
+ template <class Rep, class Period >
+ bool try_lock_for(chrono::duration<Rep, Period> const& relative_time)
+ {
+ #if 1
+ return this->timed_lock(boost::convert_to<posix_time::time_duration>(relative_time));
+ #else
+ return lockable::try_lock_for(*this, relative_time);
+ #endif
         }
 
         bool try_lock_until(::boost::system_time const& absolute_time)
@@ -200,6 +248,35 @@
             if(!try_lock_until(absolute_time)) throw timeout_exception();
         }
 
+ template<typename Clock, typename Duration>
+ bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ #if 1
+ return this->timed_lock(boost::convert_to<posix_time::ptime>(abs_time));
+ #else
+ return lockable::try_lock_until(*this, abs_time);
+ #endif
+ }
+
+ template<typename Clock, typename Duration>
+ void lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ #if 1
+ if(!this->timed_lock(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ #else
+ lockable::lock_until(*this, abs_time);
+ #endif
+ }
+ template<typename Rep, typename Period>
+ void lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {
+ #if 1
+ if(!this->timed_lock(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ #else
+ lockable::lock_for(*this, rel_time);
+ #endif
+ }
+
         friend class shared_locker<Mutex,scope_tag_type>;
         friend class upgrade_locker<Mutex,scope_tag_type>;
     };
@@ -217,7 +294,13 @@
         BOOST_NON_CONST_COPY_ASSIGNEMENT_DELETE(try_unique_locker) /*< disable copy asignement >*/
 
         explicit try_unique_locker(Mutex& m_): base_type(m_, boost::defer_lock)
- { this->try_lock(); }
+ {
+ #if 1
+ this->try_lock();
+ #else
+ lockable::try_lock(*this);
+ #endif
+ }
         try_unique_locker(Mutex& m_,force_lock_t): base_type(m_)
         {}
         try_unique_locker(Mutex& m_,adopt_lock_t): base_type(m_, boost::adopt_lock)
@@ -343,7 +426,9 @@
     };
 
     template<typename Mutex>
- class shared_locker<Mutex,multi_threaded_tag>: public shared_lock_type<Mutex>::type {
+ class shared_locker<Mutex,multi_threaded_tag>:
+ public shared_lock_type<Mutex >::type
+ {
         //typename scope_tag<Mutex>::type == multi_threaded_tag
     public:
         typedef Mutex lockable_type;
@@ -515,7 +600,9 @@
 #endif
 #endif
     template<typename Mutex>
- class upgrade_locker<Mutex,multi_threaded_tag>: public upgrade_lock_type<Mutex>::type {
+ class upgrade_locker<Mutex,multi_threaded_tag>:
+ public upgrade_lock_type<Mutex>::type
+ {
         //typename scope_tag<Mutex>::type == multi_threaded_tag
     public:
         typedef Mutex lockable_type;
@@ -658,7 +745,9 @@
 
 
     template<typename Mutex>
- class upgrade_to_unique_locker<Mutex,multi_threaded_tag>: public upgrade_to_unique_locker_type<Mutex>::type {
+ class upgrade_to_unique_locker<Mutex,multi_threaded_tag>:
+ public upgrade_to_unique_locker_type<Mutex>::type
+ {
         //typename scope_tag<Mutex>::type == multi_threaded_tag
     public:
         typedef Mutex lockable_type;
@@ -689,7 +778,7 @@
         }
         Mutex* mutex() const
         {
- return static_cast<Mutex*>(this->base_type.mutex());
+ return this->base_type.mutex()->mutex();
         }
 
         bool is_locking(lockable_type* l) const {

Modified: sandbox/synchro/boost/synchro/thread/mutex.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/thread/mutex.hpp (original)
+++ sandbox/synchro/boost/synchro/thread/mutex.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -19,6 +19,9 @@
 #include <boost/synchro/thread/lockable_scope_traits.hpp>
 #include <boost/synchro/timeout_exception.hpp>
 #include <boost/synchro/detail/deleted_functions.hpp>
+#include <boost/synchro/lockable/functions.hpp>
+#include <boost/convert_to/chrono_time_point_to_posix_time_ptime.hpp>
+#include <boost/convert_to/chrono_duration_to_posix_time_duration.hpp>
 
 
 namespace boost { namespace synchro {
@@ -71,8 +74,8 @@
     typedef boost::lock_error type;
 };
 
-#if 0
-typedef boost::mutex thread_mutex;
+#if 1
+//typedef boost::mutex thread_mutex;
 
 template<>
 struct timed_interface_tag<boost::mutex> {
@@ -148,10 +151,33 @@
     void lock_for(TimeDuration const & relative_time) {
         if(!timed_lock(relative_time)) throw timeout_exception();
     }
+
+ template<typename Clock, typename Duration>
+ bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ return timed_lock(boost::convert_to<posix_time::ptime>(abs_time));
+ }
+ template<typename Rep, typename Period>
+ bool try_lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {
+ return timed_lock(boost::convert_to<posix_time::time_duration>(rel_time));
+ }
+
+ template<typename Clock, typename Duration>
+ void lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ if(!timed_lock(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ }
+ template<typename Rep, typename Period>
+ void lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {
+ if(!timed_lock(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ }
+
 };
 
-#if 0
-typedef boost::timed_mutex thread_timed_mutex;
+#if 1
+//typedef boost::timed_mutex thread_timed_mutex;
 
 template<>
 struct timed_interface_tag<boost::timed_mutex> {
@@ -190,6 +216,38 @@
 };
 
 #endif
+namespace lockable {
+ namespace partial_specialization_workaround {
+ template <class Clock, class Duration >
+ struct lock_until<boost::timed_mutex,Clock, Duration> {
+ static void
+ apply( boost::timed_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ if(!lockable.timed_lock(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ }
+ };
+ template <class Rep, class Period >
+ struct lock_for<boost::timed_mutex,Rep, Period> {
+ static void
+ apply( boost::timed_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ if(!lockable.timed_lock(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ }
+ };
+ template <class Clock, class Duration >
+ struct try_lock_until<boost::timed_mutex,Clock, Duration> {
+ static typename result_of::template try_lock_until<boost::timed_mutex,Clock, Duration>::type
+ apply( boost::timed_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.timed_lock(boost::convert_to<posix_time::ptime>(abs_time));
+ }
+ };
+ template <class Rep, class Period >
+ struct try_lock_for<boost::timed_mutex,Rep, Period> {
+ static typename result_of::template try_lock_for<boost::timed_mutex,Rep, Period>::type
+ apply( boost::timed_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.timed_lock(boost::convert_to<posix_time::time_duration>(rel_time));
+ }
+ };
+ }
+}
 }
 }
 

Modified: sandbox/synchro/boost/synchro/thread/recursive_mutex.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/thread/recursive_mutex.hpp (original)
+++ sandbox/synchro/boost/synchro/thread/recursive_mutex.hpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -17,6 +17,9 @@
 #include <boost/synchro/lockable_traits.hpp>
 #include <boost/synchro/timeout_exception.hpp>
 #include <boost/synchro/detail/deleted_functions.hpp>
+#include <boost/synchro/lockable/functions.hpp>
+#include <boost/convert_to/chrono_time_point_to_posix_time_ptime.hpp>
+#include <boost/convert_to/chrono_duration_to_posix_time_duration.hpp>
 
 namespace boost { namespace synchro {
 
@@ -41,8 +44,8 @@
     BOOST_COPY_ASSIGNEMENT_DELETE(thread_recursive_mutex) /*< disable copy asignement >*/
     thread_recursive_mutex() {}
 };
-#if 0
-typedef boost::recursive_mutex thread_recursive_mutex;
+#if 1
+//typedef boost::recursive_mutex thread_recursive_mutex;
 
 template<>
 struct timed_interface_tag<boost::recursive_mutex> {
@@ -117,11 +120,33 @@
     template<typename TimeDuration>
     void lock_for(TimeDuration const & relative_time)
     {if(!timed_lock(relative_time)) throw timeout_exception();}
+
+ template<typename Clock, typename Duration>
+ bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ return timed_lock(boost::convert_to<posix_time::ptime>(abs_time));
+ }
+ template<typename Rep, typename Period>
+ bool try_lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {
+ return timed_lock(boost::convert_to<posix_time::time_duration>(rel_time));
+ }
+
+ template<typename Clock, typename Duration>
+ void lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ if(!timed_lock(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ }
+ template<typename Rep, typename Period>
+ void lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {
+ if(!timed_lock(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ }
     
 };
 
-#if 0
-typedef boost::recursive_timed_mutex thread_recursive_timed_mutex;
+#if 1
+//typedef boost::recursive_timed_mutex thread_recursive_timed_mutex;
 
 template<>
 struct timed_interface_tag<boost::recursive_timed_mutex> {
@@ -160,6 +185,40 @@
 };
 
 #endif
+
+namespace lockable {
+ namespace partial_specialization_workaround {
+ template <class Clock, class Duration >
+ struct lock_until<boost::recursive_timed_mutex,Clock, Duration> {
+ static void
+ apply( boost::recursive_timed_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ if(!lockable.timed_lock(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ }
+ };
+ template <class Rep, class Period >
+ struct lock_for<boost::recursive_timed_mutex,Rep, Period> {
+ static void
+ apply( boost::recursive_timed_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ if(!lockable.timed_lock(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ }
+ };
+ template <class Clock, class Duration >
+ struct try_lock_until<boost::recursive_timed_mutex,Clock, Duration> {
+ static typename result_of::template try_lock_until<boost::recursive_timed_mutex,Clock, Duration>::type
+ apply( boost::recursive_timed_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.timed_lock(boost::convert_to<posix_time::ptime>(abs_time));
+ }
+ };
+ template <class Rep, class Period >
+ struct try_lock_for<boost::recursive_timed_mutex,Rep, Period> {
+ static typename result_of::template try_lock_for<boost::recursive_timed_mutex,Rep, Period>::type
+ apply( boost::recursive_timed_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.timed_lock(boost::convert_to<posix_time::time_duration>(rel_time));
+ }
+ };
+ }
+}
+
 }
 }
 

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-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -17,6 +17,9 @@
 #include <boost/synchro/thread/lockable_scope_traits.hpp>
 #include <boost/synchro/timeout_exception.hpp>
 #include <boost/synchro/detail/deleted_functions.hpp>
+#include <boost/synchro/lockable/functions.hpp>
+#include <boost/convert_to/chrono_time_point_to_posix_time_ptime.hpp>
+#include <boost/convert_to/chrono_duration_to_posix_time_duration.hpp>
 
 namespace boost { namespace synchro {
 
@@ -65,11 +68,56 @@
     void lock_shared_for(TimeDuration const& abs_time)
     {if(!timed_lock_shared(abs_time)) throw timeout_exception();}
     
+ template<typename Clock, typename Duration>
+ bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ return timed_lock(boost::convert_to<posix_time::ptime>(abs_time));
+ }
+ template<typename Rep, typename Period>
+ bool try_lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {
+ return timed_lock(boost::convert_to<posix_time::time_duration>(rel_time));
+ }
+
+ template<typename Clock, typename Duration>
+ void lock_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ if(!timed_lock(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ }
+ template<typename Rep, typename Period>
+ void lock_for(chrono::duration<Rep, Period> const & rel_time)
+ {
+ if(!timed_lock(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ }
+
+//
+ template<typename Clock, typename Duration>
+ bool try_lock_shared_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ return timed_lock_shared(boost::convert_to<posix_time::ptime>(abs_time));
+ }
+ template<typename Rep, typename Period>
+ bool try_lock_shared_for(chrono::duration<Rep, Period> const & rel_time)
+ {
+ return timed_lock_shared(boost::convert_to<posix_time::time_duration>(rel_time));
+ }
+
+ template<typename Clock, typename Duration>
+ void lock_shared_until(chrono::time_point<Clock, Duration> const & abs_time)
+ {
+ if(!timed_lock_shared(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ }
+ template<typename Rep, typename Period>
+ void lock_shared_for(chrono::duration<Rep, Period> const & rel_time)
+ {
+ if(!timed_lock_shared(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ }
+
 };
 
-#if 0
+#if 1
 
-typedef boost::shared_mutex thread_shared_mutex;
+//typedef boost::shared_mutex thread_shared_mutex;
 
 template<>
 struct timed_interface_tag<boost::shared_mutex> {
@@ -109,6 +157,70 @@
 };
 #endif
 
+namespace lockable {
+ namespace partial_specialization_workaround {
+ template <class Clock, class Duration >
+ struct lock_until<boost::shared_mutex,Clock, Duration> {
+ static void
+ apply( boost::shared_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ if(!lockable.timed_lock(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ }
+ };
+ template <class Rep, class Period >
+ struct lock_for<boost::shared_mutex,Rep, Period> {
+ static void
+ apply( boost::shared_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ if(!lockable.timed_lock(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ }
+ };
+ template <class Clock, class Duration >
+ struct try_lock_until<boost::shared_mutex,Clock, Duration> {
+ static typename result_of::template try_lock_until<boost::shared_mutex,Clock, Duration>::type
+ apply( boost::shared_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.timed_lock(boost::convert_to<posix_time::ptime>(abs_time));
+ }
+ };
+ template <class Rep, class Period >
+ struct try_lock_for<boost::shared_mutex,Rep, Period> {
+ static typename result_of::template try_lock_for<boost::shared_mutex,Rep, Period>::type
+ apply( boost::shared_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.timed_lock(boost::convert_to<posix_time::time_duration>(rel_time));
+ }
+ };
+
+ template <class Clock, class Duration >
+ struct lock_shared_until<boost::shared_mutex,Clock, Duration> {
+ static void
+ apply( boost::shared_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ if(!lockable.timed_lock_shared(boost::convert_to<posix_time::ptime>(abs_time))) throw timeout_exception();
+ }
+ };
+ template <class Rep, class Period >
+ struct lock_shared_for<boost::shared_mutex,Rep, Period> {
+ static void
+ apply( boost::shared_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ if(!lockable.timed_lock_shared(boost::convert_to<posix_time::time_duration>(rel_time))) throw timeout_exception();
+ }
+ };
+ template <class Clock, class Duration >
+ struct try_lock_shared_until<boost::shared_mutex,Clock, Duration> {
+ static typename result_of::template try_lock_shared_until<boost::shared_mutex,Clock, Duration>::type
+ apply( boost::shared_mutex& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.timed_lock_shared(boost::convert_to<posix_time::ptime>(abs_time));
+ }
+ };
+ template <class Rep, class Period >
+ struct try_lock_shared_for<boost::shared_mutex,Rep, Period> {
+ static typename result_of::template try_lock_shared_for<boost::shared_mutex,Rep, Period>::type
+ apply( boost::shared_mutex& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.timed_lock_shared(boost::convert_to<posix_time::time_duration>(rel_time));
+ }
+ };
+
+ }
+}
+
+
 template <>
 struct unique_lock_type<thread_shared_mutex> {
     typedef boost::unique_lock<boost::shared_mutex> type;

Modified: sandbox/synchro/libs/synchro/test/Jamfile.v2
==============================================================================
--- sandbox/synchro/libs/synchro/test/Jamfile.v2 (original)
+++ sandbox/synchro/libs/synchro/test/Jamfile.v2 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -20,18 +20,20 @@
         <include>$(BOOST_ROOT)
         <include>../../..
         <include>../../../../interthreads
+ <include>../../../../chrono
         
         <threading>multi
 # <target-os>cygwin
- <threading>multi
         #<threadapi>pthread
         <variant>debug
-
+
         #<library>/boost/test//boost_unit_test_framework/<link>static
         #<library>/boost/thread//boost_thread/<link>static
+ <library>../../../../chrono/libs/chrono/build//boost_chrono/<link>static
         
         <library>../../../../../boost_1_38_0/libs/test/build//boost_unit_test_framework/<link>static
         <library>../../../../../boost_1_38_0/libs/thread/build//boost_thread/<link>static
+ <library>../../../../../boost_1_38_0/libs/system/build//boost_system/<link>static
       
 ;
 
@@ -42,31 +44,35 @@
 
 
      
-test-suite sync_lock_traits :
+test-suite "sync_lock_traits" :
      [ run thread_count.cpp ]
      [ compile lockable_traits_test.cpp ]
      [ compile lockable_concepts_test.cpp ]
      [ compile locker_concepts_test.cpp ]
- [ run sync_buffer_family_test.cpp ]
+# [ run sync_buffer_family_test.cpp ]
 ## [ run sync_buffer_monitor_test.cpp ]
- [ run nested_reverse_locker_test.cpp ]
+# [ run nested_reverse_locker_test.cpp ]
+ ;
+
+test-suite "lockables" :
+ [ run test_generic_locks.cpp ]
     ;
 
 test-suite "compile_fail_test" :
- [ compile-fail ../example/IL_BancAccount.cpp : <define>BOOST_SYNCHRO_DO_NOT_COMPILE : IL_BancAccount_comp_fail ]
+# [ compile-fail ../example/IL_BancAccount.cpp : <define>BOOST_SYNCHRO_DO_NOT_COMPILE : IL_BancAccount_comp_fail ]
     ;
     
 test-suite "examples" :
- [ run ../example/BankAccount.cpp ]
- [ run ../example/SingleBuf.cpp ]
- [ run ../example/Master_Slave.cpp ]
+# [ run ../example/BankAccount.cpp ]
+# [ run ../example/SingleBuf.cpp ]
+# [ run ../example/Master_Slave.cpp ]
 ## [ run ../example/HotelReservation.cpp ]
- [ link ../example/QualifiedSingleBuf.cpp ]
- [ run ../example/Histogram.cpp ]
- [ run ../example/IL_BancAccount.cpp ]
- [ run-fail ../example/IL_Lockable_BancAccount.cpp ]
- [ run ../example/IL_Rec_Lockable_BancAccount.cpp ]
- [ run ../example/IEL_Rec_Lockable_BancAccount.cpp ]
- [ run ../example/EL_BancAccount.cpp ]
+# [ link ../example/QualifiedSingleBuf.cpp ]
+# [ run ../example/Histogram.cpp ]
+# [ run ../example/IL_BancAccount.cpp ]
+# [ run-fail ../example/IL_Lockable_BancAccount.cpp ]
+# [ run ../example/IL_Rec_Lockable_BancAccount.cpp ]
+# [ run ../example/IEL_Rec_Lockable_BancAccount.cpp ]
+# [ run ../example/EL_BancAccount.cpp ]
     ;
     
\ No newline at end of file

Modified: sandbox/synchro/libs/synchro/test/lockable_concepts_test.cpp
==============================================================================
--- sandbox/synchro/libs/synchro/test/lockable_concepts_test.cpp (original)
+++ sandbox/synchro/libs/synchro/test/lockable_concepts_test.cpp 2009-03-16 18:33:15 EDT (Mon, 16 Mar 2009)
@@ -49,21 +49,34 @@
 BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<poly::upgradable_lock_adapter<null_mutex> >));
 
 BOOST_CONCEPT_ASSERT((LockableConcept<thread_mutex>));
+BOOST_CONCEPT_ASSERT((LockableConcept<boost::mutex>));
 
 
 BOOST_CONCEPT_ASSERT((LockableConcept<thread_timed_mutex>));
 BOOST_CONCEPT_ASSERT((TimedLockableConcept<thread_timed_mutex>));
 
+BOOST_CONCEPT_ASSERT((LockableConcept<boost::timed_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<boost::timed_mutex>));
+
 BOOST_CONCEPT_ASSERT((LockableConcept<thread_recursive_mutex>));
+BOOST_CONCEPT_ASSERT((LockableConcept<boost::recursive_mutex>));
 
 BOOST_CONCEPT_ASSERT((LockableConcept<thread_recursive_timed_mutex>));
 BOOST_CONCEPT_ASSERT((TimedLockableConcept<thread_recursive_timed_mutex>));
+BOOST_CONCEPT_ASSERT((LockableConcept<boost::recursive_timed_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<boost::recursive_timed_mutex>));
 
 BOOST_CONCEPT_ASSERT((LockableConcept<thread_shared_mutex>));
 BOOST_CONCEPT_ASSERT((TimedLockableConcept<thread_shared_mutex>));
 BOOST_CONCEPT_ASSERT((ShareLockableConcept<thread_shared_mutex>));
 BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<thread_shared_mutex>));
 
+BOOST_CONCEPT_ASSERT((LockableConcept<boost::shared_mutex>));
+BOOST_CONCEPT_ASSERT((TimedLockableConcept<boost::shared_mutex>));
+BOOST_CONCEPT_ASSERT((ShareLockableConcept<boost::shared_mutex>));
+BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<boost::shared_mutex>));
+
+#if 0
 BOOST_CONCEPT_ASSERT((LockableConcept<interprocess_mutex>));
 BOOST_CONCEPT_ASSERT((TimedLockableConcept<synchro::interprocess_mutex>));
 
@@ -83,9 +96,4 @@
 BOOST_CONCEPT_ASSERT((ShareLockableConcept<synchro::interprocess_named_upgradable_mutex>));
 BOOST_CONCEPT_ASSERT((UpgradeLockableConcept<boost::synchro::interprocess_named_upgradable_mutex>));
 
-//____________________________________________________________________________//
-
-
-//____________________________________________________________________________//
-
-// EOF
+#endif


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