Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2007-10-16 09:31:26


Johan Nilsson wrote:

>> * timed_lock functions now take boost::system_time (a typedef to
>> boost::posix_time::ptime from the date_time library) rather than xtime
>
> If you are going to make a breaking change - why not add an time_duration
> overload, please? Even if almost everything is better than the current xtime
> interface, I've so far never had a requirement to use an absolute time for
> waiting or sleeping. Absolute times is most often just a real pain to use,
> and in its current implementation also misleading.
>
> (I've read the rationale in Programming with POSIX Threads, but I'm not
> convinced.)

n2320 calls for interfaces with time_duration on all timed_lock functions.
Only the condition variable adds an absolute time (eg: system_time) which is
to handle spurious wakeups. Looking at the latest code on the trunk, I can
see that Anthony hasn't switched the interface to handle time_durations in all
cases, but he has in Mutex:

class mutex {

    template<typename TimeDuration>
    bool timed_lock(TimeDuration const & relative_time);

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk