httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Gruno <rum...@cord.dk>
Subject Re: Fwd: svn commit: r1369656 - in /httpd/httpd/trunk/modules/lua: lua_vmprep.c lua_vmprep.h mod_lua.c mod_lua.h
Date Mon, 06 Aug 2012 09:30:46 GMT
On 08/06/2012 09:23 AM, Rüdiger Plüm wrote:
> 
> 
> -------- Original Message --------
> Subject:     svn commit: r1369656 - in /httpd/httpd/trunk/modules/lua:
> lua_vmprep.c lua_vmprep.h mod_lua.c mod_lua.h
> Date:     Sun, 05 Aug 2012 19:57:45 GMT
> From:     humbedooh@apache.org
> 
> 
> 
> Author: humbedooh
> Date: Sun Aug  5 19:57:44 2012
> New Revision: 1369656
> 
> URL: http://svn.apache.org/viewvc?rev=1369656&view=rev
> Log:
> Add a server scope for Lua states (in LuaScope), which creates a pool
> of  states with manageable
> minimum and maximum size.
> 
> Modified:
>      httpd/httpd/trunk/modules/lua/lua_vmprep.c
>      httpd/httpd/trunk/modules/lua/lua_vmprep.h
>      httpd/httpd/trunk/modules/lua/mod_lua.c
>      httpd/httpd/trunk/modules/lua/mod_lua.h
> 
> Modified: httpd/httpd/trunk/modules/lua/lua_vmprep.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_vmprep.c?rev=1369656&r1=1369655&r2=1369656&view=diff
> 
> ==============================================================================
> 
> --- httpd/httpd/trunk/modules/lua/lua_vmprep.c (original)
> +++ httpd/httpd/trunk/modules/lua/lua_vmprep.c Sun Aug  5 19:57:44 2012
> @@ -23,6 +23,15 @@
> 
>   APLOG_USE_MODULE(lua);
> 
> +#if APR_HAS_THREADS
> +    apr_thread_mutex_t *ap_lua_mutex;
> +
> +void ap_lua_init_mutex(apr_pool_t *pool, server_rec *s)
> +{
> +    apr_thread_mutex_create(&ap_lua_mutex, APR_THREAD_MUTEX_DEFAULT,
> pool);
> +}
> +#endif
> +
> 
> Shouldn't you use the httpd mutex API here to keep the mutex type
> configureable in a generic way?
> See util_mutex.c / ap_mutex_register.
> 
> Regards
> 
> Rüdiger
> 
> 
Hi Rüdiger,
When I looked into how httpd works with mutexes, I looked at mod_dbd for
inspiration, and it used the apr_thread_mutex stuff for its handling of
the process pools, so that's what I used. Shame on me :)

I have changed it to use the ap_mutex functions/structs now, so all
should be well (unless I managed to mess that up too ;) ).

With regards and thanks as usual for your reviews,
Daniel.

Mime
View raw message