apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@covalent.net>
Subject Re: [2.0] does not compile without threads
Date Mon, 19 Nov 2001 22:37:10 GMT
On Monday 19 November 2001 12:47 pm, Aaron Bannert wrote:
> On Mon, Nov 19, 2001 at 12:09:56PM -0800, Ryan Bloom wrote:
> > On Monday 19 November 2001 09:19 am, Aaron Bannert wrote:
> > > What is the right way to handle this? I don't think we should we be
> > > conditionally compiling declarations, only implementations. We can
> > > either go for runtime errors (APR_ENOTIMPL) when functionality is
> > > non-existant (--disable-threads), or we'll have to go around putting
> > > #if blocks around all the code references.
> >
> > We should always opt for compile time errors over run-time errors,
> > because it makes the error easier to see and fix.  I would say, fix
> > mod_ssl by #if'ing the code.
>
> There are many other places where we make calls to the lock API without
> checking APR_HAS_THREADS. I'm not so sure anymore that APR_HAS_THREADS
> is even appropriate for the entire lock API (eg. crossprocess locks).

It isn't appropriate for the full lock API, it is only appropriate for the thread
locks.

> For the locks that do depend on a threading library (apr_thread_*_t)
> how about we #error if the header was included but APR_HAS_THREADS
> is not defined?

I wouldn't #error, I would just #ifdef the whole file personally.  Otherwise, you will
need to conditionally include the header file, which always seem like more trouble
than it's worth.  But that is just a personal preference of mine.

Ryan


______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Mime
View raw message