httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Querna <c...@force-elite.com>
Subject Re: Getting pool associated with current thread/child
Date Sun, 08 Feb 2009 00:13:23 GMT
Philip M. Gollucci 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).
>>
>> Paul suggested that this is not possible, presently, and suggested
>> adding a current_thread field to the request_rec, which each mpm would
>> need to ensure is correct when it does things with the request (I
>> would be more specific, but "does things" is as detailed as I can go
>> at the moment ;-).
>>
>> Alternately, an APR function like apr_current_thread(): *apr_thread_t,
>> would, I believe satisfy my need as I believe I can get the pool from
>> the thread struct.
>>
>> Not sure the best path forward, suggestions?
>>
>> -Brian
> 
> apr_os_thread_current()
> Its already in APR and IIRC, mod_perl is using it, is that not what you 
> want ?

That gets you the os thread, aka a pthread_t.

It doesn't get you the apr_pool_t that APR has associated with its own 
apr_thread_t that APR created when it made the thread.

I think the only way to do this is to extend the request rec, or 
significantly change the APR API around threads and pools, with the 
later being a much more complicated exercise

-Paul

Mime
View raw message