How to read /proc/locks in safe mode?
d.lesca at solinos.it
Fri Jul 15 17:04:13 UTC 2011
Il giorno ven, 15/07/2011 alle 17.48 +0100, Dan Mills ha scritto:
> The thing is ANY processing is inherently going to be racy, at least
> some of the time.
> The way to find out of part of a file is locked, is to try to take the
> lock yourself (LOCK_NB as an argument to flock may be useful here),
> if you get it then it was not held, and if your attempt fails then the
> lock is held by something else.
Ok, this is a way for try to resolve my problem, I check it. Thanks
> ANYTHING else is going to give you inherently out of date information
> that may change from under you.
yes, i saw it
> You really need to find another way to do whatever it is you are
> really trying to do, why does a third party need to know which locks
> are held?
Because is a third part software and the producer do not give us that
information, so I thought read /proc/locks for establish if a process is
active via our lock on this file.
Ok, thank Dan for suggest.
Dario Lesca <d.lesca at solinos.it>
More information about the devel