Re: [Boost-bugs] [Boost C++ Libraries] #7980: Build error: msvc-11.0 and BOOST_THREAD_DONT_USE_DATETIME

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7980: Build error: msvc-11.0 and BOOST_THREAD_DONT_USE_DATETIME
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-05 21:59:19


#7980: Build error: msvc-11.0 and BOOST_THREAD_DONT_USE_DATETIME
-------------------------------+--------------------------------------------
  Reporter: anonymous | Owner: viboes
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.53.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------

Comment (by viboes):

 Does this patch fixes the issue?


 {{{
 svn diff ../../../boost/thread/win32/shared_mutex.hpp
 Index: ../../../boost/thread/win32/shared_mutex.hpp
 ===================================================================
 --- ../../../boost/thread/win32/shared_mutex.hpp (revision 82706)
 +++ ../../../boost/thread/win32/shared_mutex.hpp (working copy)
 @@ -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)

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7980#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC