pthread_mutex_timedlock with time in past

Joel Sherrill joel.sherrill at OARcorp.com
Sat Aug 28 18:22:57 UTC 2010


On 08/28/2010 12:08 PM, Peter Dufault wrote:
> On Aug 28, 2010, at 10:24 , Joel Sherrill wrote:
>
>    
>> I was reviewing this code and wanted to
>> make sure that ...
>>
>> + lock is busy (e.g. unavailable)
>> + absolute time is in the past
>>
>> We should return ETIMEDOUT not EBUSY.
>>
>> The OpenGroup page is this but I am missing
>> the exact phrase which tells us what to do.
>>      
> "The *timeout shall expire* when the absolute time specified by abs_timeout passes, as measured by the clock on which timeouts are based (that is, when the value of that clock equals or exceeds abs_timeout), *or if the absolute time specified by abs_timeout has already been passed at the time of the call*."
> ...
> "[ETIMEDOUT]
> The mutex could not be locked before the specified timeout expired."
>
> I think those two imply you should return ETIMEDOUT.
>
>    
OK.  I will try to propagate the current code to old branches.

Thanks.
> Peter
> -----------------
> Peter Dufault
> HD Associates, Inc.      Software and System Engineering
>
>    




More information about the users mailing list