apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: apr_temp_dir_get()
Date Wed, 11 Apr 2007 09:57:30 GMT
On Mon, Apr 09, 2007 at 10:26:57AM -0400, Jim Jagielski wrote:
> Hmmm... While looking over some proxy changes, for some
> reason my eyes were pulled to apr_temp_dir_get(). Note
> that the comments state:
>     "Our goal is to find a temporary directory suitable for writing
>      into.  We'll only pay the price once if we're successful -- we
>      cache our successful find."
> Except we don't (cache); neither in 0.9.x or trunk.
> So is the comment broken or the code? Methinks the code,
> but I'm sure one reason was due to potential thread
> safety issues... ?

The original apr_temp_dir_get() implementation did use a static variable 
to cache the result, so that's probably what the comment refers to; but 
as you suspect it wasn't thread safe so this was fixed.  (not sure if 
the non-thread-safe-code even made it into a release)


View raw message