Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 97515 invoked from network); 21 Jul 2005 14:21:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jul 2005 14:21:04 -0000 Received: (qmail 25068 invoked by uid 500); 21 Jul 2005 14:20:49 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 24927 invoked by uid 500); 21 Jul 2005 14:20:49 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 24879 invoked by uid 99); 21 Jul 2005 14:20:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2005 07:20:48 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [195.224.39.74] (HELO midgard.webthing.com) (195.224.39.74) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2005 07:20:41 -0700 Received: by midgard.webthing.com (Postfix, from userid 501) id C314F46CD; Thu, 21 Jul 2005 15:20:42 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by midgard.webthing.com (Postfix) with ESMTP id BDCD046B2; Thu, 21 Jul 2005 15:20:42 +0100 (BST) Date: Thu, 21 Jul 2005 15:20:42 +0100 (BST) From: Nick Kew To: Henry Jen Cc: Subject: Re: Recursive mutex In-Reply-To: <42DEF9DF.4010902@ztune.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Wed, 20 Jul 2005, Henry Jen wrote: > I need to have recursive(NESTED) mutex support in our project. > > Currently apr is relying on pthread lib to provide > pthread_mutexattr_settype to provide recursive support, unfortunately, > that does not seem to be in POSIX standard and is not available on the > requested linux platform(see > http://www.lynuxworks.com/products/posix/function-calls.php3). > > I plan to implement that in apr by extend current apr_thread_mutex_t to > include a pthread_t and an integer for count, and modify the lock/unlock > accordingly. So here are couple questions: > > 1. Is this a reasonable solution or I overlook something? Or maybe > someone had done similar? Looks reasonable to me at first glance. Bear in mind that anything APR exports should be cross-platform, so you'll want to implement it in the platform-independent layer. Unless I'm misunderstanding the scope of what you propose. > 2. How fast can this modification can be rolled into a formal apr > release? It is going to be API compatible but not ABI(as the structure > changed, only in the case of underlying pthread lib does not support > recursive mutex, so should be OK) That's likely to be a while: it'll need to get reviewed, agreed on, and then used in a test version for a while, then await sufficient general agreement for a release incorporating it. -- Nick Kew