apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel May" <dan...@spryware.com>
Subject RE: cross-process, named mutex
Date Tue, 15 Nov 2005 19:58:49 GMT
Neither  apr_proc_mutex or apr_global_mutex seem to work under Linux.  I created a simple single
instance case
where I created a named mutex in an test program and paused.  I started a second instance
and I was granted the mutex.
The lock is not holding.

Daniel


-----Original Message-----
From: Michael Vergoz [mailto:mv@binarysec.com] 
Sent: Tuesday, November 15, 2005 4:48 AM
To: Daniel May
Subject: Re: cross-process, named mutex

hi,

it's little difficult to make a mutex global in Apache. in normal case you may create a shared
map with apr_mmap_create() ... and store the mutex in it with apr_proc_mutex(). now you can
used the apr global mutex api to do that with apr_global_mutex_create(). you may have a look
at the file srclib/apr/locks/unix/global_mutex.c and at srclib/apr/test/testglobalmutex.c.

- michael


Le 15 nov. 05 à 05:35, Daniel May a écrit :

> Is there any way under APR Linux to create a cross-process, named  
> Mutex
> ?  Under Win32, I simply call CreateMutex() with a name.  Do I have to
> create a piece of shared mem and store the pthreads mutex ?
>
> Daniel May
>
>
>
>
>
>





Mime
View raw message