Boost logo

Boost Users :

Subject: Re: [Boost-users] [inteprocess] timed_lock absolute time
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-12-30 20:12:59


On 12/30/2011 3:51 AM, Ion Gaztañaga wrote:
> El 30/12/2011 1:56, Edward Diener escribió:
>> On 12/29/2011 5:50 PM, Ion Gaztañaga wrote:
>>> El 27/12/2011 2:17, Edward Diener escribió:
>>>> Is the "absolute time" mentioned when using a mutex and timed_lock a
>>>> local time or a UTC time ? I am guessing a local time but I just
>>>> want to
>>>> make sure.
>>>
>>> If you see code, it's universal_time() (UTC)
>>
>> I do not know what you mean by "if you see code". If I want to set a
>> duration of 10 seconds beyond the current time for my timed_lock to
>> expire, are you saying I should pass:
>>
>> boost::date_time::second_clock<boost::posix_time::ptime>::universal_time()
>>
>> + boost::posix_time::seconds(10)
>
> Yes. I should document it, but internally the library uses
> universal_time().

OK, that is a surprise ! You really need to document that all timed
locks in interprocess use UTC and not local time. IMO saying "absolute
time" as you do in the doc does not infer UTC, and it is more than
natural to wrongly assume local time.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net