Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2D575200C6A for ; Wed, 19 Apr 2017 17:25:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2BCF4160B94; Wed, 19 Apr 2017 15:25:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4C44D160B86 for ; Wed, 19 Apr 2017 17:25:31 +0200 (CEST) Received: (qmail 86651 invoked by uid 500); 19 Apr 2017 15:25:29 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 86637 invoked by uid 99); 19 Apr 2017 15:25:29 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Apr 2017 15:25:29 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 124FB3A002A for ; Wed, 19 Apr 2017 15:25:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1791932 - in /apr/apr/branches/1.6.x: CHANGES configure.in include/apr.h.in locks/unix/global_mutex.c locks/unix/proc_mutex.c locks/unix/thread_mutex.c test/testlock.c test/testprocmutex.c Date: Wed, 19 Apr 2017 15:25:28 -0000 To: commits@apr.apache.org From: niq@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170419152529.124FB3A002A@svn01-us-west.apache.org> archived-at: Wed, 19 Apr 2017 15:25:32 -0000 Author: niq Date: Wed Apr 19 15:25:28 2017 New Revision: 1791932 URL: http://svn.apache.org/viewvc?rev=1791932&view=rev Log: Make timedlocks a configuration option. After first Mac then Solaris biting us, timedlocks look high-risk, so a config option and a corresponding rlease note offer a workaround to any users who get bitten. Modified: apr/apr/branches/1.6.x/CHANGES apr/apr/branches/1.6.x/configure.in apr/apr/branches/1.6.x/include/apr.h.in apr/apr/branches/1.6.x/locks/unix/global_mutex.c apr/apr/branches/1.6.x/locks/unix/proc_mutex.c apr/apr/branches/1.6.x/locks/unix/thread_mutex.c apr/apr/branches/1.6.x/test/testlock.c apr/apr/branches/1.6.x/test/testprocmutex.c Modified: apr/apr/branches/1.6.x/CHANGES URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/CHANGES?rev=1791932&r1=1791931&r2=1791932&view=diff ============================================================================== --- apr/apr/branches/1.6.x/CHANGES [utf-8] (original) +++ apr/apr/branches/1.6.x/CHANGES [utf-8] Wed Apr 19 15:25:28 2017 @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes for APR 1.6.1 + *) Locks: add a --disable-timedlocks config option in case users + encounter more platforms where it fails [Nick Kew]. Changes for APR 1.6.0 Modified: apr/apr/branches/1.6.x/configure.in URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/configure.in?rev=1791932&r1=1791931&r2=1791932&view=diff ============================================================================== --- apr/apr/branches/1.6.x/configure.in (original) +++ apr/apr/branches/1.6.x/configure.in Wed Apr 19 15:25:28 2017 @@ -2789,6 +2789,12 @@ AC_MSG_RESULT($ipv6_result) AC_SUBST(have_ipv6) +AC_ARG_ENABLE(timedlocks, + [ --disable-timedlocks Disable timed locks ], + [apr_has_timedlocks="0"], [apr_has_timedlocks="1"] +) +AC_SUBST(apr_has_timedlocks) + # hstrerror is only needed if IPv6 is not enabled, # so getaddrinfo/gai_strerror are not used. if test $have_ipv6 = 0; then Modified: apr/apr/branches/1.6.x/include/apr.h.in URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/include/apr.h.in?rev=1791932&r1=1791931&r2=1791932&view=diff ============================================================================== --- apr/apr/branches/1.6.x/include/apr.h.in (original) +++ apr/apr/branches/1.6.x/include/apr.h.in Wed Apr 19 15:25:28 2017 @@ -280,6 +280,7 @@ extern "C" { #define APR_HAS_LARGE_FILES @aprlfs@ #define APR_HAS_XTHREAD_FILES @apr_has_xthread_files@ #define APR_HAS_OS_UUID @osuuid@ +#define APR_HAS_TIMEDLOCKS @apr_has_timedlocks@ #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD @apr_procattr_user_set_requires_password@ Modified: apr/apr/branches/1.6.x/locks/unix/global_mutex.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/unix/global_mutex.c?rev=1791932&r1=1791931&r2=1791932&view=diff ============================================================================== --- apr/apr/branches/1.6.x/locks/unix/global_mutex.c (original) +++ apr/apr/branches/1.6.x/locks/unix/global_mutex.c Wed Apr 19 15:25:28 2017 @@ -145,6 +145,7 @@ APR_DECLARE(apr_status_t) apr_global_mut APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex, apr_interval_time_t timeout) { +#if APR_HAS_TIMEDLOCKS apr_status_t rv; #if APR_HAS_THREADS @@ -177,6 +178,9 @@ APR_DECLARE(apr_status_t) apr_global_mut #endif /* APR_HAS_THREADS */ return rv; +#else /* APR_HAS_TIMEDLOCKS */ + return APR_ENOTIMPL; +#endif } APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex) Modified: apr/apr/branches/1.6.x/locks/unix/proc_mutex.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/unix/proc_mutex.c?rev=1791932&r1=1791931&r2=1791932&view=diff ============================================================================== --- apr/apr/branches/1.6.x/locks/unix/proc_mutex.c (original) +++ apr/apr/branches/1.6.x/locks/unix/proc_mutex.c Wed Apr 19 15:25:28 2017 @@ -1560,7 +1560,11 @@ APR_DECLARE(apr_status_t) apr_proc_mutex APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex, apr_interval_time_t timeout) { +#if APR_HAS_TIMEDLOCKS return mutex->meth->timedacquire(mutex, timeout); +#else + return APR_ENOTIMPL; +#endif } APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex) Modified: apr/apr/branches/1.6.x/locks/unix/thread_mutex.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/locks/unix/thread_mutex.c?rev=1791932&r1=1791931&r2=1791932&view=diff ============================================================================== --- apr/apr/branches/1.6.x/locks/unix/thread_mutex.c (original) +++ apr/apr/branches/1.6.x/locks/unix/thread_mutex.c Wed Apr 19 15:25:28 2017 @@ -193,6 +193,7 @@ APR_DECLARE(apr_status_t) apr_thread_mut apr_interval_time_t timeout) { apr_status_t rv = APR_ENOTIMPL; +#if APR_HAS_TIMEDLOCKS #ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK if (timeout <= 0) { @@ -269,6 +270,7 @@ APR_DECLARE(apr_status_t) apr_thread_mut #endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ +#endif /* APR_HAS_TIMEDLOCKS */ return rv; } Modified: apr/apr/branches/1.6.x/test/testlock.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/test/testlock.c?rev=1791932&r1=1791931&r2=1791932&view=diff ============================================================================== --- apr/apr/branches/1.6.x/test/testlock.c (original) +++ apr/apr/branches/1.6.x/test/testlock.c Wed Apr 19 15:25:28 2017 @@ -392,12 +392,16 @@ abts_suite *testlock(abts_suite *suite) abts_run_test(suite, threads_not_impl, NULL); #else abts_run_test(suite, test_thread_mutex, NULL); +#if APR_HAS_TIMEDLOCKS abts_run_test(suite, test_thread_timedmutex, NULL); +#endif abts_run_test(suite, test_thread_rwlock, NULL); abts_run_test(suite, test_cond, NULL); abts_run_test(suite, test_timeoutcond, NULL); +#if APR_HAS_TIMEDLOCKS abts_run_test(suite, test_timeoutmutex, NULL); #endif +#endif return suite; } Modified: apr/apr/branches/1.6.x/test/testprocmutex.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/test/testprocmutex.c?rev=1791932&r1=1791931&r2=1791932&view=diff ============================================================================== --- apr/apr/branches/1.6.x/test/testprocmutex.c (original) +++ apr/apr/branches/1.6.x/test/testprocmutex.c Wed Apr 19 15:25:28 2017 @@ -184,6 +184,7 @@ static void test_exclusive(abts_case *tc *x == MAX_COUNTER); } +#if APR_HAS_TIMEDLOCKS rv = apr_proc_mutex_timedlock(proc_lock, 1); if (rv == APR_ENOTIMPL) { fprintf(stderr, "%s_timedlock() not implemented, ", mech->name); @@ -220,6 +221,7 @@ static void test_exclusive(abts_case *tc ABTS_ASSERT(tc, "Locks don't appear to work with timedlock", *x == MAX_COUNTER); } +#endif /* APR_HAS_TIMEDLOCKS */ } static void proc_mutex(abts_case *tc, void *data)