apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel May" <dan...@spryware.com>
Subject RE: apr_proc_trylock for linux
Date Mon, 15 May 2006 13:09:20 GMT
I ran into this same problem.  I used the apr_proc_mutex_trylock under
windows to check if a process is already running.  This does not work
under other OS's.  My solution was to create a shared memory segment to
store sharable pthread mutex information.  Not very portable, but solved
my problem.

The apr proc mutex's seem to favor being inherited rather than working
between two unrelated processes.

/Daniel May

-----Original Message-----
From: Hans-Peter Weidinger [mailto:hans-peter@hp-weidinger.at] 
Sent: Monday, May 15, 2006 7:57 AM
To: dev@apr.apache.org
Subject: apr_proc_trylock for linux

I've written an application that should recognize, if another instance
of the process is already running.
The app should run under linux and windows.

Unfortunately i've developed it under Windows, and used a process mutex
to find out, if another instance is running.

I've used the "apr_proc_mutex_trylock" to check for other processes.

unfortunately when moving to linux i found out, that this is a

Is there any way (or version) to activate the trylock mechanism for

Any hint appreciated.


View raw message