|
Boost : |
Subject: Re: [boost] [thread] sleep() with time_duration?
From: Howard Hinnant (hinnant_at_[hidden])
Date: 2008-11-14 18:29:18
On Nov 14, 2008, at 5:56 PM, vicente.botet wrote:
> ----- Original Message ----- From: "Anthony Williams" <anthony.ajw_at_[hidden]
> >
> To: <boost_at_[hidden]>
> Sent: Friday, November 14, 2008 1:36 PM
> Subject: Re: [boost] [thread] sleep() with time_duration?
>
>
>> Boris <boriss_at_[hidden]> writes:
>>> It would be nice if it was possible to pass a time_duration object
>>> to
>>> sleep() directly:
>>>
>>> boost::thread::sleep(boost::posix_time::seconds(5));
>> boost::thread::sleep is only provided for backwards compatibility.
>> boost::this_thread::sleep has the absolute time/duration overloads
>> you
>> desire:
>> boost::this_thread::sleep(boost::posix_time::seconds(5));
>
> The current proposal n2497 contains two overloadings
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html
> void boost::this_thread::sleep(const system_time& abs_t);
> template <class Duration>
> void boost::this_thread::sleep(const Duration& rel_t);
>
> Boost.Thread contains only the template <class Duration>
> void boost::this_thread::sleep(const Duration& rel_t);
>
> Could you add the other?
N2497 was overridden by N2661:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm#Threads_wording
This is all put together in the latest working draft:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf
namespace std {
namespace this_thread {
template <class Clock, class Duration>
void sleep_until(const chrono::time_point<Clock, Duration>&
abs_time);
template <class Rep, class Period>
void sleep_for(const chrono::duration<Rep, Period>& rel_time);
}
}
-Howard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk