On Mon, 18 Jul 2005, Sudhanshu Prakash wrote: > Hi *, > > I am using apr_* api's in my apache module and scenario is like as > follows: > > 1) In init_module, I am creating one apr_global_mutex_t > and registering a cleanup function which destroys the mutex. init_module? The following in a post_config hook works fine for me: apr_global_mutex_create(&global_mutex, global_fname, APR_LOCK_DEFAULT, pool) ; unixd_set_global_mutex_perms(global_mutex) ; apr_pool_cleanup_register(pool, global_mutex, (void*)apr_global_mutex_destroy, apr_pool_cleanup_null) ; > > 2) In init_child, I am re-opening the same mutex using > apr_global_mutex_child_init Yep, that's right. > 3) During Graceful restart, there is a race condition between mutex > destruction and child-restart i.e. Mutex is destroyed first while old > httpd childrens are still running and throws an error "(22), Invalid > Argument". (This scenario is easy to replicate when http is pumped with > high number of http requests and simultaneously i do graceful restart) Hmmm, I haven't had that problem. You need to tell us what hook you are referring to as init_module. BTW, this would be more on-topic for the apache-modules list. -- Nick Kew --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx