apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1791728 - /apr/apr/trunk/locks/unix/proc_mutex.c
Date Mon, 17 Apr 2017 21:53:45 GMT
Author: ylavic
Date: Mon Apr 17 21:53:45 2017
New Revision: 1791728

URL: http://svn.apache.org/viewvc?rev=1791728&view=rev
Log:
locks: follow up to r1790436.

Fix proc_mutex_pthread_acquire_ex() for the APR_USE_PROC_PTHREAD_MUTEX_COND
case which shouldn't use undefined pthread_cond_timedwait().


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=1791728&r1=1791727&r2=1791728&view=diff
==============================================================================
--- apr/apr/trunk/locks/unix/proc_mutex.c (original)
+++ apr/apr/trunk/locks/unix/proc_mutex.c Mon Apr 17 21:53:45 2017
@@ -681,9 +681,6 @@ static apr_status_t proc_mutex_pthread_c
 static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex,
                                                   apr_interval_time_t timeout)
 {
-#if !APR_USE_PROC_PTHREAD_MUTEX_COND && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
-    return proc_mutex_spinsleep_timedacquire(mutex, timeout);
-#else
     apr_status_t rv;
 
 #if APR_USE_PROC_PTHREAD_MUTEX_COND
@@ -777,7 +774,9 @@ static apr_status_t proc_mutex_pthread_a
                 }
             }
         }
-        else {
+        else
+#if defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
+        {
             struct timespec abstime;
 
             timeout += apr_time_now();
@@ -805,11 +804,13 @@ static apr_status_t proc_mutex_pthread_a
 #endif
             return rv;
         }
+#else /* !HAVE_PTHREAD_MUTEX_TIMEDLOCK */
+        return proc_mutex_spinsleep_timedacquire(mutex, timeout);
+#endif
     }
 
     mutex->curr_locked = 1;
     return APR_SUCCESS;
-#endif
 }
 
 static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex)



Mime
View raw message