Boost logo

Boost :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2006-11-02 10:58:25


On Nov 2, 2006, at 10:09 AM, Anthony Williams wrote:
> Your sample adaptor has given me the idea of not having an explicit
> timed_lock
> function, but rather overloads of try_lock:
>
> bool try_lock(); // just try once
> bool try_lock(unsigned spin_count); // spin this many times
> bool try_lock(target_time_type target_time); // wait until the
> specified time
> bool try_lock(time_period_type wait_time); // wait for the
> specified period

Sorry, naive user just woke up and saw this fly by...

Are there conversions from integral types to target_time_type and/or
time_period_type?
If so, I would be quite surprised if try_lock(1000) spun 1,000 times
before failing, rather than 1,000 milliseconds (for instance).

        Cheers,
        Doug


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