* locks/unix/thread_mutex.c,
  include/arch/unix/apr_arch_thread_mutex.h: Completely drop the code
  required imitate the mutex via a condition variable if
  HAVE_PTHREAD_MUTEX_TIMEDLOCK is defined.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1891204 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/include/arch/unix/apr_arch_thread_mutex.h b/include/arch/unix/apr_arch_thread_mutex.h
index 4fe46c3..0844bed 100644
--- a/include/arch/unix/apr_arch_thread_mutex.h
+++ b/include/arch/unix/apr_arch_thread_mutex.h
@@ -33,8 +33,10 @@
 struct apr_thread_mutex_t {
     apr_pool_t *pool;
     pthread_mutex_t mutex;
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
     apr_thread_cond_t *cond;
     int locked, num_waiters;
+#endif
 };
 #endif
 
diff --git a/locks/unix/thread_mutex.c b/locks/unix/thread_mutex.c
index 5e21aac..9cd643b 100644
--- a/locks/unix/thread_mutex.c
+++ b/locks/unix/thread_mutex.c
@@ -121,6 +121,7 @@
 {
     apr_status_t rv;
 
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
     if (mutex->cond) {
         apr_status_t rv2;
 
@@ -152,6 +153,7 @@
 
         return rv;
     }
+#endif
 
     rv = pthread_mutex_lock(&mutex->mutex);
 #ifdef HAVE_ZOS_PTHREADS
@@ -167,6 +169,7 @@
 {
     apr_status_t rv;
 
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
     if (mutex->cond) {
         apr_status_t rv2;
 
@@ -196,6 +199,7 @@
 
         return rv;
     }
+#endif
 
     rv = pthread_mutex_trylock(&mutex->mutex);
     if (rv) {
@@ -298,6 +302,7 @@
 {
     apr_status_t status;
 
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
     if (mutex->cond) {
         status = pthread_mutex_lock(&mutex->mutex);
         if (status) {
@@ -320,6 +325,7 @@
 
         mutex->locked = 0;
     }
+#endif
 
     status = pthread_mutex_unlock(&mutex->mutex);
 #ifdef HAVE_ZOS_PTHREADS
@@ -335,9 +341,12 @@
 {
     apr_status_t rv, rv2 = APR_SUCCESS;
 
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
     if (mutex->cond) {
         rv2 = apr_thread_cond_destroy(mutex->cond);
     }
+#endif
+
     rv = apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup);
     if (rv == APR_SUCCESS) {
         rv = rv2;