Skip to content

Commit

Permalink
reverse the use of dattime and chrono when chrono is acceptable.
Browse files Browse the repository at this point in the history
  • Loading branch information
viboes committed Sep 8, 2015
1 parent ac3f7eb commit b30cde3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions include/boost/thread/win32/shared_mutex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ namespace boost

void lock_shared()
{
#if defined BOOST_THREAD_USES_DATETIME
BOOST_VERIFY(timed_lock_shared(::boost::detail::get_system_time_sentinel()));
#else
#ifdef BOOST_THREAD_USES_CHRONO
BOOST_VERIFY(try_lock_shared_until(chrono::steady_clock::now()));
#else
//#if defined BOOST_THREAD_USES_DATETIME
BOOST_VERIFY(timed_lock_shared(::boost::detail::get_system_time_sentinel()));
#endif
}

Expand Down Expand Up @@ -389,10 +390,12 @@ namespace boost

void lock()
{
#if defined BOOST_THREAD_USES_DATETIME
BOOST_VERIFY(timed_lock(::boost::detail::get_system_time_sentinel()));
#else

#ifdef BOOST_THREAD_USES_CHRONO
BOOST_VERIFY(try_lock_until(chrono::steady_clock::now()));
#else
//#if defined BOOST_THREAD_USES_DATETIME
BOOST_VERIFY(timed_lock(::boost::detail::get_system_time_sentinel()));
#endif
}

Expand Down

0 comments on commit b30cde3

Please sign in to comment.