On Sun, Feb 8, 2009 at 3:54 PM, Paul Querna <[email protected]> wrote:
> I think doing it via the mpm/extending the request rec is the right way > to do it, and I don't understand why there is resistance to just doing > it that way? I don't think there is resistance, it is just a chunk of code *I* am not comfortable making changes to as I do not grok it, yet. If you make such a change, or can point me to something to explain how they work, it seems like a good approach -- we'll just need to document that it is not safe to hold onto the pool if you use it. -Brian > > >> >> On Sun, Feb 8, 2009 at 10:22 AM, Brian McCallister <[email protected]> wrote: >>> On Sat, Feb 7, 2009 at 5:47 PM, Graham Leggett <[email protected]> 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 >>>> -- >>>> > >
