Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 165A8174EB for ; Wed, 25 Mar 2015 06:19:37 +0000 (UTC) Received: (qmail 90705 invoked by uid 500); 25 Mar 2015 06:19:16 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 90655 invoked by uid 500); 25 Mar 2015 06:19:16 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 90642 invoked by uid 99); 25 Mar 2015 06:19:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Mar 2015 06:19:15 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of prvs=05267bef56=micha@lenk.info designates 188.40.85.232 as permitted sender) Received: from [188.40.85.232] (HELO mx.lenk.info) (188.40.85.232) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Mar 2015 06:18:49 +0000 Received: from [192.168.77.232] (port=48486 helo=mailstore.lenk.local) by mx.lenk.info with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1YaecI-00023F-0s; Wed, 25 Mar 2015 07:16:38 +0100 Received: from [192.168.2.43] (gateway.home.lenk.info [213.144.156.188]) by mailstore.lenk.local (Postfix) with ESMTPSA id 610E11A0E4; Wed, 25 Mar 2015 07:16:35 +0100 (CET) Message-ID: <55125380.7010408@lenk.info> Date: Wed, 25 Mar 2015 07:19:44 +0100 From: Micha Lenk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 To: Yann Ylavic , modules-dev@httpd.apache.org Subject: Re: How to wait on a global lock with timeout References: <54295C2F.80307@lenk.info> <542AF4CB.90006@lenk.info> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Yann, Am 20.03.2015 um 02:59 schrieb Yann Ylavic: > a few times later, commited in [1] and [2] :) Wow, thanks for coming back to that issue. > Can you please check if it works for you? I only had time to review the code changes. I looked at the implementation of apr_global_mutex_timedlock(). There I noticed that, if APR_HAS_THREADS, you are doing 3 timed operations without checking the remaining time. If all operations take almost the given timeout, this can in the end result in almost 3 times the allowed value. To mitigate that design flaw I would provide the timeout by reference and update it by the functions using it. This has also the nice benefit that the caller is able to retrieve the time it needed to wait. I hope to have some time to check out the new functions in my code soon. > I also attached the patch against 1.6.x, if that can help... > It should also apply to 1.5.x, though it will never be backported > there (due to API changes). Backports are not needed. Thanks for offering. Regards, Micha