httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: [users@httpd] HELP .... apr_pool_t and apr_global_mutex _
Date Mon, 18 Jul 2005 14:16:52 GMT

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.


The following in a post_config hook works fine for me:

  apr_global_mutex_create(&global_mutex, global_fname,
  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:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message