httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "César Leonardo Blum Silveira" <cesa...@gmail.com>
Subject Destroying global mutexes
Date Wed, 07 May 2008 13:04:07 GMT
Hi all,

I am having some issues when registering cleanups to destroy global
mutexes created in my module's post_config phase. Basically, if I
register a cleanup in the server pool that calls
apr_global_mutex_destroy, the server doesn't survive graceful
restarts. In order to restart Apache, I need to stop it and start it
again.

I was reading the mod_ssl code and noticed it doesn't call
apr_global_mutex_destroy at any moment, even though it creates a
global mutex using apr_global_mutex_create. Is it "wrong" then to
register apr_global_mutex_destroy as a cleanup for the server pool?

Also, I notived the post_config hook is run both in the parent and
child processes (I am running Apache on Windows, so there is only one
child process). That means my global mutex creation calls are being
done twice. Isn't that also a bug?

I am using the apr_pool_userdata_get/apr_pool_userdata_set "hack" in
order to avoid running code twice. I thought that would also prevent
the post_config code from being run on the child process, since the
child process' pool should be inherited from the parent (is that
right?).

Any hints on that?

Thank you,

-- 
César L. B. Silveira

Mime
View raw message