Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52038 - sandbox/synchro/boost/synchro/thread
From: vicente.botet_at_[hidden]
Date: 2009-03-28 14:07:46


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

Log:
0.3.1 : Usage of Boost/Chrono

Text files modified:
   sandbox/synchro/boost/synchro/thread/locks.hpp | 248 ++++++++++++++++-----------------------
   sandbox/synchro/boost/synchro/thread/mutex.hpp | 37 +----
   sandbox/synchro/boost/synchro/thread/recursive_mutex.hpp | 25 +--
   sandbox/synchro/boost/synchro/thread/shared_mutex.hpp | 34 ----
   4 files changed, 125 insertions(+), 219 deletions(-)

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-28 14:07:46 EDT (Sat, 28 Mar 2009)
@@ -72,41 +72,24 @@
         unique_locker(Mutex& m_,try_to_lock_t): base_type(m_, boost::try_to_lock)
         {}
 
- unique_locker(Mutex& m_,system_time const& target_time): base_type(m_, target_time)
- {}
- template<typename TimeDuration>
- 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 Rep, typename Period>
+ unique_locker(Mutex& m_, chrono::duration<Rep, Period> const& target_time)
+ : base_type(m_, boost::convert_to<posix_time::time_duration>(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))
         {}
+ template <typename Rep, typename Period>
+ unique_locker(nothrow_timeout_t, chrono::duration<Rep, Period> const& target_time, Mutex& m_)
+ : base_type(m_, boost::convert_to<posix_time::time_duration>(target_time))
+ {}
 
- unique_locker(Mutex& m_,system_time const& target_time, throw_timeout_t)
- : base_type(m_, boost::defer_lock)
- {
- lock_until(target_time);
- }
- template<typename TimeDuration>
- unique_locker(Mutex& m_,TimeDuration const& target_time, throw_timeout_t)
- : base_type(m_, boost::defer_lock)
- {
- lock_for(target_time);
- }
 
         template <class Clock, class Duration>
         unique_locker(Mutex& m_,chrono::time_point<Clock, Duration> const& target_time, throw_timeout_t)
@@ -114,23 +97,24 @@
         {
             lock_until(target_time);
         }
-
- template<typename TimeDuration>
- unique_locker(TimeDuration const& target_time, Mutex& m_)
+ template <typename Rep, typename Period>
+ unique_locker(Mutex& m_, chrono::duration<Rep, Period> const& target_time, throw_timeout_t)
             : base_type(m_, boost::defer_lock)
         {
             lock_for(target_time);
         }
- unique_locker(system_time const& target_time, Mutex& m_)
+
+ 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);
         }
- template <class Clock, class Duration>
- unique_locker(chrono::time_point<Clock, Duration> const& target_time, Mutex& m_)
+ template <typename Rep, typename Period>
+ unique_locker(chrono::duration<Rep, Period> const& target_time, Mutex& m_)
             : base_type(m_, boost::defer_lock)
         {
- lock_until(target_time);
+ lock_for(target_time);
         }
 #ifdef BOOST_HAS_RVALUE_REFS
         unique_locker(unique_locker&& other): base_type(other)
@@ -212,69 +196,27 @@
             return l==mutex();
         } /*< strict lockers specific function >*/
 
- template<typename TimeDuration>
- bool try_lock_for(TimeDuration const& relative_time)
+ template<typename Clock, typename Duration>
+ bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
         {
- #if 1
- return this->timed_lock(relative_time);
- #else
- try_lock_for(*this, relative_time);
- #endif
+ return this->timed_lock(boost::convert_to<posix_time::ptime>(abs_time));
         }
 
         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)
- {
- return this->timed_lock(absolute_time);
- }
-
- template<typename TimeDuration>
- void lock_for(TimeDuration const& relative_time)
- {
- if(!try_lock_for(relative_time)) throw timeout_exception();
- }
-
- void lock_until(::boost::system_time const& absolute_time)
- {
- 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>;
@@ -293,57 +235,59 @@
         BOOST_NON_CONST_COPY_CONSTRUCTOR_DELETE(try_unique_locker) /*< disable copy construction >*/
         BOOST_NON_CONST_COPY_ASSIGNEMENT_DELETE(try_unique_locker) /*< disable copy asignement >*/
 
- explicit try_unique_locker(Mutex& m_): base_type(m_, boost::defer_lock)
+ explicit try_unique_locker(Mutex& m_): base_type(m_, defer_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)
+ try_unique_locker(Mutex& m_,adopt_lock_t tag): base_type(m_, tag)
         {}
- try_unique_locker(Mutex& m_,defer_lock_t): base_type(m_, boost::defer_lock)
+ try_unique_locker(Mutex& m_,defer_lock_t tag): base_type(m_, tag)
         {}
- try_unique_locker(Mutex& m_,try_to_lock_t): base_type(m_, boost::try_to_lock)
+ try_unique_locker(Mutex& m_,try_to_lock_t tag): base_type(m_, tag)
         {}
             
- try_unique_locker(Mutex& m_,system_time const& target_time): base_type(m_, target_time)
+ template<typename Clock, typename Duration>
+ try_unique_locker(Mutex& m_, chrono::time_point<Clock, Duration> const& abs_time)
+ : base_type(m_, boost::convert_to<posix_time::ptime>(abs_time))
         {}
- template<typename TimeDuration>
- try_unique_locker(Mutex& m_,TimeDuration const& target_time): base_type(m_, target_time)
+ template<typename Rep, typename Period>
+ try_unique_locker(Mutex& m_,chrono::duration<Rep, Period> const& rel_time)
+ : base_type(m_, boost::convert_to<posix_time::time_duration>(rel_time))
         {}
             
- try_unique_locker(nothrow_timeout_t, system_time const& target_time, Mutex& m_)
- : base_type(m_, target_time)
+ template<typename Clock, typename Duration>
+ try_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))
         {}
- template<typename TimeDuration>
- try_unique_locker(nothrow_timeout_t, TimeDuration const& target_time, Mutex& m_)
+ template<typename Rep, typename Period>
+ try_unique_locker(nothrow_timeout_t, chrono::duration<Rep, Period> const& target_time, Mutex& m_)
             : base_type(m_, target_time)
         {}
 
 
- try_unique_locker(Mutex& m_,system_time const& target_time, throw_timeout_t)
+ template<typename Clock, typename Duration>
+ try_unique_locker(Mutex& m_,chrono::time_point<Clock, Duration> const& target_time, throw_timeout_t)
             : base_type(m_, boost::defer_lock)
         {
             this->lock_until(target_time);
         }
- template<typename TimeDuration>
- try_unique_locker(Mutex& m_,TimeDuration const& target_time, throw_timeout_t)
+ template<typename Rep, typename Period>
+ try_unique_locker(Mutex& m_,chrono::duration<Rep, Period> const& target_time, throw_timeout_t)
             : base_type(m_, boost::defer_lock)
         {
             this->lock_for(target_time);
         }
         
- try_unique_locker(system_time const& target_time, Mutex& m_)
+ template<typename Clock, typename Duration>
+ try_unique_locker(chrono::time_point<Clock, Duration> const& target_time, Mutex& m_)
             : base_type(m_, boost::defer_lock)
         {
             this->lock_until(target_time);
         }
- template<typename TimeDuration>
- try_unique_locker(TimeDuration const& target_time, Mutex& m_)
+ template<typename Rep, typename Period>
+ try_unique_locker(chrono::duration<Rep, Period> const& target_time, Mutex& m_)
             : base_type(m_, boost::defer_lock)
         {
             this->lock_for(target_time);
@@ -448,45 +392,49 @@
         shared_locker(Mutex& m_,try_to_lock_t): base_type(m_, boost::try_to_lock)
         {}
             
- shared_locker(Mutex& m_,system_time const& target_time)
+ template<typename Clock, typename Duration>
+ shared_locker(Mutex& m_,chrono::time_point<Clock, Duration> const& target_time)
             : base_type(m_, boost::defer_lock)
         {
             try_lock_until(target_time);
         }
- template<typename TimeDuration>
- shared_locker(Mutex& m_,TimeDuration const& target_time)
+ template<typename Rep, typename Period>
+ shared_locker(Mutex& m_,chrono::duration<Rep, Period> const& target_time)
             : base_type(m_, boost::defer_lock)
         {
             try_lock_for(target_time);
         }
             
- shared_locker(nothrow_timeout_t, system_time const& target_time, Mutex& m_)
- : base_type(m_, target_time)
+ template<typename Clock, typename Duration>
+ shared_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))
         {}
- template<typename TimeDuration>
- shared_locker(nothrow_timeout_t, TimeDuration const& target_time, Mutex& m_)
+ template<typename Rep, typename Period>
+ shared_locker(nothrow_timeout_t, chrono::duration<Rep, Period> const& target_time, Mutex& m_)
         {
             try_lock_for(target_time);
         }
             
- shared_locker(Mutex& m_,system_time const& target_time,throw_timeout_t)
+ template<typename Clock, typename Duration>
+ shared_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>
- shared_locker(Mutex& m_,TimeDuration const& target_time,throw_timeout_t)
+ template<typename Rep, typename Period>
+ shared_locker(Mutex& m_,chrono::duration<Rep, Period> const& target_time,throw_timeout_t)
             : base_type(m_, boost::defer_lock)
         {
             lock_for(target_time);
         }
         
- template<typename TimeDuration>
- shared_locker(TimeDuration const& target_time, Mutex& m_)
+ template<typename Rep, typename Period>
+ shared_locker(chrono::duration<Rep, Period> const& target_time, Mutex& m_)
         {
             lock_for(target_time);
         }
- shared_locker(system_time const& target_time, Mutex& m_)
+ template<typename Clock, typename Duration>
+ shared_locker(chrono::time_point<Clock, Duration> const& target_time, Mutex& m_)
             : base_type(m_, boost::defer_lock)
         {
             lock_until(target_time);
@@ -561,25 +509,27 @@
             return l==mutex();
         } /*< strict lockers specific function >*/
 
- bool try_lock_until(boost::system_time const& absolute_time)
+ template<typename Clock, typename Duration>
+ bool try_lock_until(boost::chrono::time_point<Clock, Duration> const& absolute_time)
         {
- return this->timed_lock(absolute_time);
+ return this->timed_lock(boost::convert_to<posix_time::ptime>(absolute_time));
         }
- template<typename Duration>
- bool try_lock_for(Duration const& relative_time)
+ template<typename Rep, typename Period>
+ bool try_lock_for(chrono::duration<Rep, Period> const& relative_time)
         {
- return this->timed_lock(relative_time);
+ return this->timed_lock(boost::convert_to<posix_time::time_duration>(relative_time));
         }
 
- template<typename TimeDuration>
- void lock_for(TimeDuration const& relative_time)
+ template<typename Rep, typename Period>
+ void lock_for(chrono::duration<Rep, Period> const& relative_time)
         {
- if(!try_lock_for(relative_time)) throw timeout_exception();
+ if(!this->try_lock_for(relative_time)) throw timeout_exception();
         }
 
- void lock_until(::boost::system_time const& absolute_time)
+ template<typename Clock, typename Duration>
+ void lock_until(::boost::chrono::time_point<Clock, Duration> const& absolute_time)
         {
- if(!try_lock_until(absolute_time)) throw timeout_exception();
+ if(!this->try_lock_until(absolute_time)) throw timeout_exception();
         }
 
     };
@@ -623,47 +573,51 @@
         upgrade_locker(Mutex& m_,try_to_lock_t): base_type(m_, boost::try_to_lock)
         {}
 
- upgrade_locker(Mutex& m_,system_time const& target_time)
+ template<typename Clock, typename Duration>
+ upgrade_locker(Mutex& m_,chrono::time_point<Clock, Duration> const& target_time)
             : base_type(m_, boost::defer_lock)
         {
- try_lock_until(target_time);
+ this->try_lock_until(target_time);
         }
- template<typename TimeDuration>
- upgrade_locker(Mutex& m_,TimeDuration const& target_time)
+ template<typename Rep, typename Period>
+ upgrade_locker(Mutex& m_,chrono::duration<Rep, Period> const& target_time)
             : base_type(m_, boost::defer_lock)
         {
- try_lock_for(target_time);
+ this->try_lock_for(target_time);
         }
             
- upgrade_locker(nothrow_timeout_t, system_time const& target_time, Mutex& m_)
+ template<typename Clock, typename Duration>
+ upgrade_locker(nothrow_timeout_t, chrono::time_point<Clock, Duration> const& target_time, Mutex& m_)
             : base_type(m_, boost::defer_lock)
         {
- try_lock_until(target_time);
+ this->try_lock_until(target_time);
         }
- template<typename TimeDuration>
- upgrade_locker(nothrow_timeout_t, TimeDuration const& target_time, Mutex& m_)
+ template<typename Rep, typename Period>
+ upgrade_locker(nothrow_timeout_t, chrono::duration<Rep, Period> const& target_time, Mutex& m_)
         {
- try_lock_for(target_time);
+ this->try_lock_for(target_time);
         }
             
- upgrade_locker(Mutex& m_,system_time const& target_time,throw_timeout_t)
+ template<typename Clock, typename Duration>
+ upgrade_locker(Mutex& m_,chrono::time_point<Clock, Duration> const& target_time,throw_timeout_t)
             : base_type(m_, boost::defer_lock)
         {
             this->lock_until(target_time);
         }
- template<typename TimeDuration>
- upgrade_locker(Mutex& m_,TimeDuration const& target_time,throw_timeout_t)
+ template<typename Rep, typename Period>
+ upgrade_locker(Mutex& m_,chrono::duration<Rep, Period> const& target_time,throw_timeout_t)
             : base_type(m_, boost::defer_lock)
         {
             this->lock_for(target_time);
         }
         
- template<typename TimeDuration>
- upgrade_locker(TimeDuration const& target_time, Mutex& m_)
+ template<typename Rep, typename Period>
+ upgrade_locker(chrono::duration<Rep, Period> const& target_time, Mutex& m_)
         {
             this->lock_for(target_time);
         }
- upgrade_locker(system_time const& target_time, Mutex& m_)
+ template<typename Clock, typename Duration>
+ upgrade_locker(chrono::time_point<Clock, Duration> const& target_time, Mutex& m_)
             : base_type(m_, boost::defer_lock)
         {
             this->lock_until(target_time);
@@ -718,25 +672,27 @@
             return l==mutex();
         } /*< strict lockers specific function >*/
 
- bool try_lock_until(boost::system_time const& absolute_time)
+ template<typename Clock, typename Duration>
+ bool try_lock_until(boost::chrono::time_point<Clock, Duration> const& absolute_time)
         {
- return this->timed_lock(absolute_time);
+ return this->timed_lock(boost::convert_to<posix_time::ptime>(absolute_time));
         }
- template<typename Duration>
- bool try_lock_for(Duration const& relative_time)
+ template<typename Rep, typename Period>
+ bool try_lock_for(chrono::duration<Rep, Period> const& relative_time)
         {
- return this->timed_lock(boost::get_system_time()+relative_time);
+ return this->timed_lock(boost::convert_to<posix_time::time_duration>(relative_time));
         }
 
- template<typename TimeDuration>
- void lock_for(TimeDuration const& relative_time)
+ template<typename Rep, typename Period>
+ void lock_for(chrono::duration<Rep, Period> const& relative_time)
         {
- if(!try_lock_for(relative_time)) throw timeout_exception();
+ if(!this->try_lock_for(relative_time)) throw timeout_exception();
         }
 
- void lock_until(::boost::system_time const& absolute_time)
+ template<typename Clock, typename Duration>
+ void lock_until(::boost::chrono::time_point<Clock, Duration> const& absolute_time)
         {
- if(!try_lock_until(absolute_time)) throw timeout_exception();
+ if(!this->try_lock_until(absolute_time)) throw timeout_exception();
         }
 
         friend class shared_locker<Mutex, scope_tag_type>;

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-28 14:07:46 EDT (Sat, 28 Mar 2009)
@@ -26,7 +26,7 @@
 
 
 namespace boost { namespace synchro {
-
+#if 0
 class thread_mutex
 : public lock_traits_base<
     multi_threaded_tag,
@@ -55,12 +55,6 @@
     {
         BOOST_STATIC_CONSTANT(bool, value = true);
     };
- template<>
- struct is_lockable<boost::mutex>
- {
- BOOST_STATIC_CONSTANT(bool, value = true);
- };
-
     
 template <>
 struct unique_lock_type<thread_mutex> {
@@ -81,6 +75,12 @@
     typedef boost::upgrade_to_unique_lock<boost::mutex> type;
 };
 
+#endif
+ template<>
+ struct is_lockable<boost::mutex>
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
 
 template <>
 struct lock_error_type<boost::mutex> {
@@ -88,7 +88,7 @@
 };
 
 #if 1
-//typedef boost::mutex thread_mutex;
+typedef boost::mutex thread_mutex;
 
 template<>
 struct timed_interface_tag<boost::mutex> {
@@ -129,7 +129,7 @@
 #endif
 
 ////////////////////////////////////////////////////
-
+#if 0
 class thread_timed_mutex
 : public lock_traits_base<
     multi_threaded_tag,
@@ -149,21 +149,6 @@
     BOOST_COPY_ASSIGNEMENT_DELETE(thread_timed_mutex) /*< disable copy asignement >*/
     thread_timed_mutex () {}
         
- bool try_lock_until(system_time const & abs_time) {
- return timed_lock(abs_time);
- }
- template<typename TimeDuration>
- bool try_lock_for(TimeDuration const & relative_time) {
- return timed_lock(relative_time);
- }
-
- void lock_until(system_time const & abs_time) {
- if(!timed_lock(abs_time)) throw timeout_exception();
- }
- template<typename TimeDuration>
- void lock_for(TimeDuration const & relative_time) {
- if(!timed_lock(relative_time)) throw timeout_exception();
- }
     
     template<typename Clock, typename Duration>
     bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
@@ -188,9 +173,9 @@
     }
 
 };
-
+#endif
 #if 1
-//typedef boost::timed_mutex thread_timed_mutex;
+typedef boost::timed_mutex thread_timed_mutex;
 
 template<>
 struct timed_interface_tag<boost::timed_mutex> {

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-28 14:07:46 EDT (Sat, 28 Mar 2009)
@@ -23,7 +23,7 @@
 
 namespace boost { namespace synchro {
 
-
+#if 0
 class thread_recursive_mutex
 : public lock_traits_base<
     multi_threaded_tag,
@@ -43,9 +43,10 @@
     BOOST_COPY_CONSTRUCTOR_DELETE(thread_recursive_mutex) /*< disable copy construction >*/
     BOOST_COPY_ASSIGNEMENT_DELETE(thread_recursive_mutex) /*< disable copy asignement >*/
     thread_recursive_mutex() {}
-};
+};
+#endif
 #if 1
-//typedef boost::recursive_mutex thread_recursive_mutex;
+typedef boost::recursive_mutex thread_recursive_mutex;
 
 template<>
 struct timed_interface_tag<boost::recursive_mutex> {
@@ -87,7 +88,7 @@
 };
 #endif
 
-
+#if 0
 class thread_recursive_timed_mutex
 : public lock_traits_base<
     multi_threaded_tag,
@@ -109,18 +110,6 @@
     BOOST_COPY_ASSIGNEMENT_DELETE(thread_recursive_timed_mutex) /*< disable copy asignement >*/
     thread_recursive_timed_mutex() {}
 
- bool try_lock_until(system_time const & abs_time)
- {return this->timed_lock(abs_time);}
- template<typename TimeDuration>
- bool try_lock_for(TimeDuration const & relative_time)
- {return timed_lock(relative_time);}
-
- void lock_until(system_time const & abs_time)
- {if(!timed_lock(abs_time)) throw timeout_exception();}
- template<typename TimeDuration>
- void lock_for(TimeDuration const & relative_time)
- {if(!timed_lock(relative_time)) throw timeout_exception();}
-
     template<typename Clock, typename Duration>
     bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
     {
@@ -144,9 +133,9 @@
     }
     
 };
-
+#endif
 #if 1
-//typedef boost::recursive_timed_mutex thread_recursive_timed_mutex;
+typedef boost::recursive_timed_mutex thread_recursive_timed_mutex;
 
 template<>
 struct timed_interface_tag<boost::recursive_timed_mutex> {

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-28 14:07:46 EDT (Sat, 28 Mar 2009)
@@ -23,7 +23,7 @@
 
 namespace boost { namespace synchro {
 
-
+#if 0
 class thread_shared_mutex
 : public lock_traits_base<
     multi_threaded_tag,
@@ -43,30 +43,6 @@
     BOOST_COPY_CONSTRUCTOR_DELETE(thread_shared_mutex) /*< disable copy construction >*/
     BOOST_COPY_ASSIGNEMENT_DELETE(thread_shared_mutex) /*< disable copy asignement >*/
     thread_shared_mutex() {}
-
- bool try_lock_until(system_time const & abs_time)
- {return this->timed_lock(abs_time);}
- template<typename TimeDuration>
- bool try_lock_for(TimeDuration const & relative_time)
- {return timed_lock(relative_time);}
-
- void lock_until(system_time const & abs_time)
- {if(!timed_lock(abs_time)) throw timeout_exception();}
- template<typename TimeDuration>
- void lock_for(TimeDuration const & relative_time)
- {if(!timed_lock(relative_time)) throw timeout_exception();}
-
- bool try_lock_shared_until(system_time const& abs_time)
- {return timed_lock_shared(abs_time);}
- template<typename TimeDuration>
- bool try_lock_shared_for(TimeDuration const& rel_time)
- {return timed_lock_shared(rel_time);}
-
- void lock_shared_until(system_time const& abs_time)
- {if(!timed_lock_shared(abs_time)) throw timeout_exception();}
- template<typename TimeDuration>
- void lock_shared_for(TimeDuration const& abs_time)
- {if(!timed_lock_shared(abs_time)) throw timeout_exception();}
     
     template<typename Clock, typename Duration>
     bool try_lock_until(chrono::time_point<Clock, Duration> const & abs_time)
@@ -114,10 +90,10 @@
     }
     
 };
-
+#endif
 #if 1
 
-//typedef boost::shared_mutex thread_shared_mutex;
+typedef boost::shared_mutex thread_shared_mutex;
 
 template<>
 struct timed_interface_tag<boost::shared_mutex> {
@@ -220,7 +196,7 @@
     }
 }
 
-
+#if 0
 template <>
 struct unique_lock_type<thread_shared_mutex> {
     typedef boost::unique_lock<boost::shared_mutex> type;
@@ -241,7 +217,7 @@
 struct upgrade_to_unique_locker_type<thread_shared_mutex> {
     typedef boost::upgrade_to_unique_lock<boost::shared_mutex> type;
 };
-
+#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