procmail
[Top] [All Lists]

Re: scope of locking

1997-04-10 15:33:00
wje(_at_)netcom(_dot_)com (include "tiglet" on Subject: line to override 
spamgard{tm}) wri
tes:
Suppose I have a recipe of the form

 :0HBiw:$SGHOMEU/eeyore.lock
 * ? $SGHOMEX/eeyore.pl
 /dev/null

where eeyore.pl is a program which has lots of side effects and which
must run single-threaded, so I want eeyore.lock to be active during
the testing part of the recipe.  I have three questions.

1.  Does the lock take effect only during the action line of the
   recipe, or is it active during the testing parts as well?

Only during the action.


2.  So that I can rely on the stability of the answer to question 1,
   does that answer appear in the documentation somewhere?

Not explicitly, but I'd say you can depend on it.


3.  Has the answer to question 1 changed in recent versions of
   procmail?

It has not changed since procmail was written.

If you want to lock across a condition you need to use a global lockfile
via LOCKFILE:


        # Set a global lockfile to protect the condition
        LOCKFILE = $SGHOMEU/eeyore.lock

        :0 HBiw
        * ? $SGHOMEX/eeyore.pl
        /dev/null

        # unlock
        LOCKFILE


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>