Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52036 - sandbox/synchro/boost/synchro/lockable
From: vicente.botet_at_[hidden]
Date: 2009-03-28 13:46:22


Author: viboes
Date: 2009-03-28 13:46:20 EDT (Sat, 28 Mar 2009)
New Revision: 52036
URL: http://svn.boost.org/trac/boost/changeset/52036

Log:
0.3.1 : Usage of Boost/Chrono + free functions for conditional lockables

Added:
   sandbox/synchro/boost/synchro/lockable/lock_when.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_when_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/lock_when_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/relock_on.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/relock_on_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/relock_on_until.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/relock_when.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/relock_when_for.hpp (contents, props changed)
   sandbox/synchro/boost/synchro/lockable/relock_when_until.hpp (contents, props changed)
Text files modified:
   sandbox/synchro/boost/synchro/lockable/functions.hpp | 9 +++++++++
   1 files changed, 9 insertions(+), 0 deletions(-)

Modified: sandbox/synchro/boost/synchro/lockable/functions.hpp
==============================================================================
--- sandbox/synchro/boost/synchro/lockable/functions.hpp (original)
+++ sandbox/synchro/boost/synchro/lockable/functions.hpp 2009-03-28 13:46:20 EDT (Sat, 28 Mar 2009)
@@ -63,4 +63,13 @@
 //#include <boost/synchro/lockable/try_unlock_shared_and_lock_upgrade_until.hpp>
 //#include <boost/synchro/lockable/try_unlock_shared_and_lock_upgrade_for.hpp>
 
+
+#include <boost/synchro/lockable/lock_when.hpp>
+#include <boost/synchro/lockable/lock_when_until.hpp>
+#include <boost/synchro/lockable/lock_when_for.hpp>
+
+#include <boost/synchro/lockable/relock_when.hpp>
+#include <boost/synchro/lockable/relock_when_until.hpp>
+#include <boost/synchro/lockable/relock_when_for.hpp>
+
 #endif

Added: sandbox/synchro/boost/synchro/lockable/lock_when.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_when.hpp 2009-03-28 13:46:20 EDT (Sat, 28 Mar 2009)
@@ -0,0 +1,46 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (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_WHEN__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_WHEN__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, typename Predicate>
+ struct lock_when {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable, typename Predicate >
+ struct lock_when {
+ static typename result_of::template lock_when<Lockable,Predicate>::type
+ apply( Lockable& lockable, Predicate pred ) {
+ return lockable.lock_when(pred);
+ }
+ };
+ }
+
+ template <typename Lockable, typename Predicate>
+ typename result_of::template lock_when<Lockable,Predicate>::type
+ lock_when(Lockable& lockable, Predicate pred) {
+ return partial_specialization_workaround::lock_when<Lockable,Predicate>::apply(lockable,pred);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_when_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_when_for.hpp 2009-03-28 13:46:20 EDT (Sat, 28 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_WHEN_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_WHEN_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, typename Predicate, typename T>
+ struct lock_when_for {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable,typename Predicate, class Rep, class Period >
+ struct lock_when_for {
+ static typename result_of::template lock_when_for<Lockable,Predicate,chrono::duration<Rep, Period> >::type
+ apply( Lockable& lockable, Predicate pred, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.lock_when_for(pred, rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, typename Predicate, class Rep, class Period >
+ typename result_of::template lock_when_for<Lockable, Predicate, chrono::duration<Rep, Period> >::type
+ lock_when_for(Lockable& lockable, Predicate pred, const chrono::duration<Rep, Period>& abs_time) {
+ return partial_specialization_workaround::lock_when_for<Lockable,Predicate,Rep,Period>::apply(lockable, pred, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/lock_when_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/lock_when_until.hpp 2009-03-28 13:46:20 EDT (Sat, 28 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_WHEN_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_LOCK_WHEN_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, typename Predicate, typename T>
+ struct lock_when_until {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, typename Predicate, class Clock, class Duration >
+ struct lock_when_until {
+ static typename result_of::template lock_when_until<Lockable,Predicate,chrono::time_point<Clock, Duration> >::type
+ apply( Lockable& lockable, Predicate pred, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.lock_when_until(pred, abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, typename Predicate, class Clock, class Duration >
+ typename result_of::template lock_when_until<Lockable,Predicate,chrono::time_point<Clock, Duration> >::type
+ lock_when_until(Lockable& lockable, Predicate pred, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::lock_when_until<Lockable,Predicate,Clock,Duration>::apply(lockable, pred, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/relock_on.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/relock_on.hpp 2009-03-28 13:46:20 EDT (Sat, 28 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_RELOCK_ON__HPP
+#define BOOST_SYNCHRO_LOCKABLE_RELOCK_ON__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable>
+ struct relock_on {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable >
+ struct relock_on {
+ static typename result_of::template relock_on<Lockable>::type apply( Lockable& lockable ) {
+ return lockable.relock_on();
+ }
+ };
+ }
+
+ template <typename Lockable>
+ typename result_of::template relock_on<Lockable>::type
+ relock_on(Lockable& lockable) {
+ return partial_specialization_workaround::relock_on<Lockable>::apply(lockable);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/relock_on_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/relock_on_for.hpp 2009-03-28 13:46:20 EDT (Sat, 28 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_RELOCK_ON_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_RELOCK_ON_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 relock_on_for {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Rep, class Period >
+ struct relock_on_for {
+ static typename result_of::template relock_on_for<Lockable>::type
+ apply( Lockable& lockable, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.relock_on_for(rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Rep, class Period >
+ typename result_of::template relock_on_for<Lockable>::type
+ relock_on_for(Lockable& lockable, const chrono::duration<Rep, Period>& abs_time) {
+ return partial_specialization_workaround::relock_on_for<Lockable,Rep,Period>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/relock_on_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/relock_on_until.hpp 2009-03-28 13:46:20 EDT (Sat, 28 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_RELOCK_ON_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_RELOCK_ON_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 relock_on_until {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, class Clock, class Duration >
+ struct relock_on_until {
+ static typename result_of::template relock_on_until<Lockable,Clock,Duration>::type
+ apply( Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.relock_on_until(abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, class Clock, class Duration >
+ typename result_of::template relock_on_until<Lockable,Clock,Duration>::type
+ relock_on_until(Lockable& lockable, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::relock_on_until<Lockable,Clock,Duration>::apply(lockable, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/relock_when.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/relock_when.hpp 2009-03-28 13:46:20 EDT (Sat, 28 Mar 2009)
@@ -0,0 +1,46 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (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_RELOCK_WHEN__HPP
+#define BOOST_SYNCHRO_LOCKABLE_RELOCK_WHEN__HPP
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace synchro { namespace lockable {
+
+ namespace result_of {
+ template <typename Lockable, typename Predicate>
+ struct relock_when {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename Lockable, typename Predicate >
+ struct relock_when {
+ static typename result_of::template relock_when<Lockable,Predicate>::type
+ apply( Lockable& lockable, Predicate pred ) {
+ return lockable.relock_when(pred);
+ }
+ };
+ }
+
+ template <typename Lockable, typename Predicate>
+ typename result_of::template relock_when<Lockable,Predicate>::type
+ relock_when(Lockable& lockable, Predicate pred) {
+ return partial_specialization_workaround::relock_when<Lockable,Predicate>::apply(lockable,pred);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/relock_when_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/relock_when_for.hpp 2009-03-28 13:46:20 EDT (Sat, 28 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_RELOCK_WHEN_FOR__HPP
+#define BOOST_SYNCHRO_LOCKABLE_RELOCK_WHEN_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, typename Predicate, typename T>
+ struct relock_when_for {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable,typename Predicate, class Rep, class Period >
+ struct relock_when_for {
+ static typename result_of::template relock_when_for<Lockable,Predicate,chrono::duration<Rep, Period> >::type
+ apply( Lockable& lockable, Predicate pred, const chrono::duration<Rep, Period>& rel_time ) {
+ return lockable.relock_when_for(pred, rel_time);
+ }
+ };
+ }
+
+ template <typename Lockable, typename Predicate, class Rep, class Period >
+ typename result_of::template relock_when_for<Lockable, Predicate, chrono::duration<Rep, Period> >::type
+ relock_when_for(Lockable& lockable, Predicate pred, const chrono::duration<Rep, Period>& abs_time) {
+ return partial_specialization_workaround::relock_when_for<Lockable,Predicate,Rep,Period>::apply(lockable, pred, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif

Added: sandbox/synchro/boost/synchro/lockable/relock_when_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/synchro/boost/synchro/lockable/relock_when_until.hpp 2009-03-28 13:46:20 EDT (Sat, 28 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_RELOCK_WHEN_UNTIL__HPP
+#define BOOST_SYNCHRO_LOCKABLE_RELOCK_WHEN_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, typename Predicate, typename T>
+ struct relock_when_until {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename Lockable, typename Predicate, class Clock, class Duration >
+ struct relock_when_until {
+ static typename result_of::template relock_when_until<Lockable,Predicate,chrono::time_point<Clock, Duration> >::type
+ apply( Lockable& lockable, Predicate pred, const chrono::time_point<Clock, Duration>& abs_time ) {
+ return lockable.relock_when_until(pred, abs_time);
+ }
+ };
+ }
+
+ template <typename Lockable, typename Predicate, class Clock, class Duration >
+ typename result_of::template relock_when_until<Lockable,Predicate,chrono::time_point<Clock, Duration> >::type
+ relock_when_until(Lockable& lockable, Predicate pred, const chrono::time_point<Clock, Duration>& abs_time) {
+ return partial_specialization_workaround::relock_when_until<Lockable,Predicate,Clock,Duration>::apply(lockable, pred, abs_time);
+ }
+
+
+}}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#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