2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-10 11:52:10 +00:00

comment unuseful/redundant code

This commit is contained in:
Vicente J. Botet Escriba
2017-09-05 12:47:32 +02:00
parent d00933d5f4
commit fa1965a87c

View File

@@ -91,26 +91,27 @@ namespace boost
cv.wait_until(lk, t);
}
#if defined BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC && defined BOOST_CHRONO_HAS_CLOCK_STEADY
template <class Rep, class Period>
void sleep_for(const chrono::duration<Rep, Period>& d)
{
using namespace chrono;
if (d > duration<Rep, Period>::zero())
{
steady_clock::time_point c_timeout = steady_clock::now() + ceil<nanoseconds>(d);
sleep_until(c_timeout);
}
}
//#if defined BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC && defined BOOST_CHRONO_HAS_CLOCK_STEADY
// template <class Rep, class Period>
// void sleep_for(const chrono::duration<Rep, Period>& d)
// {
// using namespace chrono;
// if (d > duration<Rep, Period>::zero())
// {
// steady_clock::time_point c_timeout = steady_clock::now() + ceil<nanoseconds>(d);
// sleep_until(c_timeout);
// }
// }
//
// template <class Duration>
// inline BOOST_SYMBOL_VISIBLE
// void sleep_until(const chrono::time_point<chrono::steady_clock, Duration>& t)
// {
// using namespace chrono;
// sleep_for(t - steady_clock::now());
// }
template <class Duration>
inline BOOST_SYMBOL_VISIBLE
void sleep_until(const chrono::time_point<chrono::steady_clock, Duration>& t)
{
using namespace chrono;
sleep_for(t - steady_clock::now());
}
#elif defined BOOST_THREAD_SLEEP_FOR_IS_STEADY
#if defined BOOST_THREAD_SLEEP_FOR_IS_STEADY
template <class Rep, class Period>
void sleep_for(const chrono::duration<Rep, Period>& d)