httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Plüm, Rüdiger, Vodafone Group <ruediger.pl...@vodafone.com>
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:46:14 GMT


> -----Original Message-----
> From: Daniel Gruno [mailto:rumble@cord.dk]
> Sent: Montag, 6. August 2012 11:31
> To: dev@httpd.apache.org
> Subject: Re: Fwd: svn commit: r1369656 - in
> /httpd/httpd/trunk/modules/lua: lua_vmprep.c lua_vmprep.h mod_lua.c
> mod_lua.h
> 
> 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
> >
> >
> > --- 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,

Sorry for pointing you in the wrong direction. The httpd mutex API is only for
proc mutexes not for thread mutexes like you used initially (I assume you only wanted to
coordinate multiple threads within one process and not multiple child processes).
I did not notice this initially. So you can just revert your last commit.
Sorry for the inconvenience.

Regards

Rüdiger
Mime
View raw message