Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 43066 invoked from network); 11 Apr 2007 13:49:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Apr 2007 13:49:33 -0000 Received: (qmail 79656 invoked by uid 500); 11 Apr 2007 13:49:38 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 79612 invoked by uid 500); 11 Apr 2007 13:49:37 -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 79601 invoked by uid 99); 11 Apr 2007 13:49:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Apr 2007 06:49:37 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [209.133.192.6] (HELO jaguNET.com) (209.133.192.6) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Apr 2007 06:49:29 -0700 Received: from jaguNET.com (localhost [127.0.0.1]) by devsys.jaguNET.com (8.13.8/8.13.6) with ESMTP id l3BDn8rT078012; Wed, 11 Apr 2007 09:49:08 -0400 (EDT) (envelope-from jim@jaguNET.com) Received: (from jim@localhost) by devsys.jaguNET.com (8.13.6/8.13.6/Submit) id l3BDn8nG078011; Wed, 11 Apr 2007 09:49:08 -0400 (EDT) (envelope-from jim) From: Jim Jagielski Message-Id: <200704111349.l3BDn8nG078011@devsys.jaguNET.com> Subject: Re: apr_temp_dir_get() To: jorton@redhat.com (Joe Orton) Date: Wed, 11 Apr 2007 09:49:08 -0400 (EDT) Cc: dev@apr.apache.org (APR Development List) Reply-To: jim@jaguNET.com In-Reply-To: <20070411095730.GC16327@redhat.com> X-Mailer: ELM [version 2.5 PL8] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Joe Orton wrote: > > 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) > The 0.9.x branch version still uses a static global, but it still goes ahead and checks all the envars, dirs, etc anyway. In other words, it doesn't check for that the static global has been used or not, it just re-does the whole check and then tucks it away... Sounds like we need to update the comments... -- =========================================================================== Jim Jagielski [|] jim@jaguNET.com [|] http://www.jaguNET.com/ "If you can dodge a wrench, you can dodge a ball."