Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82777 - in trunk: boost/thread/win32 libs/thread/src/win32
From: vicente.botet_at_[hidden]
Date: 2013-02-07 13:43:50


Author: viboes
Date: 2013-02-07 13:43:50 EST (Thu, 07 Feb 2013)
New Revision: 82777
URL: http://svn.boost.org/trac/boost/changeset/82777

Log:
Thread: manage #7980
Text files modified:
   trunk/boost/thread/win32/shared_mutex.hpp | 13 ++++++++++++-
   trunk/libs/thread/src/win32/thread.cpp | 2 +-
   2 files changed, 13 insertions(+), 2 deletions(-)

Modified: trunk/boost/thread/win32/shared_mutex.hpp
==============================================================================
--- trunk/boost/thread/win32/shared_mutex.hpp (original)
+++ trunk/boost/thread/win32/shared_mutex.hpp 2013-02-07 13:43:50 EST (Thu, 07 Feb 2013)
@@ -133,7 +133,11 @@
 
         void lock_shared()
         {
+#if defined BOOST_THREAD_USES_DATETIME
             BOOST_VERIFY(timed_lock_shared(::boost::detail::get_system_time_sentinel()));
+#else
+ BOOST_VERIFY(try_lock_shared_until(chrono::steady_clock::now()));
+#endif
         }
 
 #if defined BOOST_THREAD_USES_DATETIME
@@ -379,14 +383,20 @@
 
         void lock()
         {
+#if defined BOOST_THREAD_USES_DATETIME
             BOOST_VERIFY(timed_lock(::boost::detail::get_system_time_sentinel()));
+#else
+ BOOST_VERIFY(try_lock_until(chrono::steady_clock::now()));
+#endif
         }
 
+#if defined BOOST_THREAD_USES_DATETIME
         template<typename TimeDuration>
         bool timed_lock(TimeDuration const & relative_time)
         {
             return timed_lock(get_system_time()+relative_time);
         }
+#endif
 
         bool try_lock()
         {
@@ -414,6 +424,7 @@
         }
 
 
+#if defined BOOST_THREAD_USES_DATETIME
         bool timed_lock(boost::system_time const& wait_until)
         {
             for(;;)
@@ -492,7 +503,7 @@
                 BOOST_ASSERT(wait_res<2);
             }
         }
-
+#endif
 #ifdef BOOST_THREAD_USES_CHRONO
         template <class Rep, class Period>
         bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)

Modified: trunk/libs/thread/src/win32/thread.cpp
==============================================================================
--- trunk/libs/thread/src/win32/thread.cpp (original)
+++ trunk/libs/thread/src/win32/thread.cpp 2013-02-07 13:43:50 EST (Thu, 07 Feb 2013)
@@ -14,7 +14,7 @@
 #endif
 //#define BOOST_THREAD_VERSION 3
 
-#include <boost/thread/thread.hpp>
+#include <boost/thread/thread_only.hpp>
 #include <boost/thread/once.hpp>
 #include <boost/thread/tss.hpp>
 #include <boost/thread/condition_variable.hpp>


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