httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Noordhuis <i...@bnoordhuis.nl>
Subject Re: APR global mutexes
Date Tue, 08 Mar 2011 23:28:44 GMT
2011/3/9 Massimo Manghi <massimo.manghi@unipr.it>:
> the subject might suggest the message is an off-topic
> for the list.

Technically it is, dev@apr.apache.org would have been a better place for it.

> To put it simple my question is: can every module in APR be used
> also to build standalone applications? More specifically: can
> apr_global_mutex_* calls be used this way?

Yes to both (first-hand experience talking here).

> The very first version of this program creates a global mutex
> and wants to use it to synchronize access to a resource shared
> between parent and child processes (a shared memory area)
>
> I've found out that, when used this way,
> apr_global_mutex_[lock|unlock|trylock] block forever. Why?
> I also tried to unlock the mutex after it was created,
> surmising the mutex could be created by _mutex_create
> as locked, but also in this case
> apr_global_mutex_unlock blocks and never returns.

Your code snippet looks sound, I can't find fault with it. You should
post it to apr-dev (preferably as a complete, compilable test case),
you'll get more and better feedback there. Mention on what platform
and with what flags you compiled APR.

Mime
View raw message