Skip to Content.
Sympa Menu

sm-sorcery - Re: [SM-Sorcery]libbdb (was libvariable)

sm-sorcery AT lists.ibiblio.org

Subject: Discussion of Sorcery related topics

List archive

Chronological Thread  
  • From: Tony Smith <tony AT smee.org>
  • To: Mark Andrews <msasgl AT msa-enterprises.com>, sm-sorcery AT lists.ibiblio.org
  • Subject: Re: [SM-Sorcery]libbdb (was libvariable)
  • Date: Tue, 8 Oct 2002 17:45:18 +0100

On Tuesday 08 October 2002 5:25 pm, Mark Andrews wrote:
> Hello All,
>
> MA> ToDo: Improve lock system, allow for resolving deadlocks.
>
> Added crude deadlock resolution. Replace "sleep 0" in getlock
> with this code:
>
> if ! ps -p $(cat $1.LOCK); then
> rm -f $1.LOCK
> fi

Another trick you might consider is using "kill -0 $(cat $1.LOCK)". It fails
if the process doesn't exist but doesn't harm the process in any way if it
does. It's much more efficient than using "ps" 'coz it doesn't scan the
process table.

Tony.






Archive powered by MHonArc 2.6.24.

Top of Page