Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 84360 invoked from network); 8 Feb 2009 18:23:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2009 18:23:19 -0000 Received: (qmail 2581 invoked by uid 500); 8 Feb 2009 18:23:17 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 2523 invoked by uid 500); 8 Feb 2009 18:23:17 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 2514 invoked by uid 99); 8 Feb 2009 18:23:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Feb 2009 10:23:17 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.221.21] (HELO mail-qy0-f21.google.com) (209.85.221.21) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Feb 2009 18:23:10 +0000 Received: by qyk14 with SMTP id 14so2283266qyk.0 for ; Sun, 08 Feb 2009 10:22:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.215.40.3 with SMTP id s3mr5513690qaj.86.1234117367254; Sun, 08 Feb 2009 10:22:47 -0800 (PST) In-Reply-To: <498E39C5.2040509@sharp.fm> References: <9338f5ad0902071514k1e834d08rd34264f3084081c8@mail.gmail.com> <498E39C5.2040509@sharp.fm> Date: Sun, 8 Feb 2009 10:22:47 -0800 Message-ID: <9338f5ad0902081022p744b7982j7ec1937a6b3b257a@mail.gmail.com> Subject: Re: Getting pool associated with current thread/child From: Brian McCallister To: dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Feb 7, 2009 at 5:47 PM, Graham Leggett wrote: > Brian McCallister wrote: > >> So, in mod_lua I need to get the apr pool associated with the current >> thread (that being the main thread if in prefork). > > What about the process_rec structure? > > In other words, r->server->process->pool? I thought this was one-per-process, where process is a real process. I need one-per-thread in in worker/event so that they don't step on each other. What I am looking for is to attach a lua_State instance to that pool, so that when the thread is retired, I can hook into cleanups, and so that I can attach the lua_State to the pool as userdata, to retrieve it later. In prefork, a process level pool would work fine, but AFAIK this is not a thread-safe thing. > > (Not sure if this is what you are looking for, but a quick glance at the > headers would suggest it probably does). > > Regards, > Graham > -- >