apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: svn commit: r1790296 - /apr/apr/trunk/locks/unix/proc_mutex.c
Date Wed, 05 Apr 2017 16:57:52 GMT
This does not seem correct at all... Why are we calling
proc_mutex_sysv_tryacquire(mutex)??

> On Apr 5, 2017, at 12:24 PM, ylavic@apache.org wrote:
> 
> Author: ylavic
> Date: Wed Apr  5 16:24:00 2017
> New Revision: 1790296
> 
> URL: http://svn.apache.org/viewvc?rev=1790296&view=rev
> Log:
> Follow up to r1667900: semtimedop() should be passed a relative timeout rather
> then absolute.
> 
> 
> Modified:
>    apr/apr/trunk/locks/unix/proc_mutex.c
> 
> Modified: apr/apr/trunk/locks/unix/proc_mutex.c
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/locks/unix/proc_mutex.c?rev=1790296&r1=1790295&r2=1790296&view=diff
> ==============================================================================
> --- apr/apr/trunk/locks/unix/proc_mutex.c (original)
> +++ apr/apr/trunk/locks/unix/proc_mutex.c Wed Apr  5 16:24:00 2017
> @@ -343,8 +343,11 @@ static apr_status_t proc_mutex_sysv_time
>     else {
>         int rc;
>         struct timespec abstime;
> -        if (!absolute) {
> -            timeout += apr_time_now();
> +        if (absolute) {
> +            timeout -= apr_time_now();
> +            if (timeout < 0) {
> +                return proc_mutex_sysv_tryacquire(mutex);
> +            }
>         }
>         abstime.tv_sec = apr_time_sec(timeout);
>         abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
> 
> 


Mime
View raw message