httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian McCallister <>
Subject Re: Getting pool associated with current thread/child
Date Sun, 08 Feb 2009 18:22:47 GMT
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

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
> --

View raw message