apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@covalent.net>
Subject Re: cvs commit: apr/locks/netware global_mutex.c
Date Thu, 21 Feb 2002 00:44:25 GMT
From: "Aaron Bannert" <aaron@clove.org>
Sent: Wednesday, February 20, 2002 6:32 PM


> On Wed, Feb 20, 2002 at 06:23:05PM -0600, William Rowe wrote:
> > > An alternative would be to #define APR_PROC_MUTEX_IS_GLOBAL
> > > in the include/arch/<foo>/proc_mutex.h and let that dictate how
> > > global_mutex.c is implemented per platform (or in the default impl.).
> 
> I did provide an alternative solution, which I think is more like what
> you were talking about but doesn't require a #define in apr.h.

What does something in the private arch/ tree have to do with eliminating a
call stack layer that isn't required.

#define apr_foo_mutex_t apr_bar_mutex_t
#define apr_foo_mutex_create apr_bar_mutex_create

client's code...


#include "apr_foo_mutex.h"

...
{
    apr_foo_mutex_t *p;

    rv = apr_foo_mutex_create(...)

Now how are you going to avoid calling apr_foo_mutex_create calling
apr_bar_mutex_create without 1. duplicating code, or 2. exposing the
synonyms to the client code [via apr/include/apr_foo_mutex.h"] ?

Either we have an extra call setup/teardown in mutexing code [already time
sensitive] or we have APR_HAS_FOO_IS_BAR_MUTEX-style declarations 
in apr.[h.in|.hw.|.nw] that feed our apr_foo_mutex.h header.

Bill


Mime
View raw message