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().
@@ -681,9 +681,6 @@ static apr_status_t proc_mutex_pthread_child_init(apr_proc_mutex_t **mutex,
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_acquire_ex(apr_proc_mutex_t *mutex,
}
}
}
- 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_acquire_ex(apr_proc_mutex_t *mutex,
#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)
