in reply to Question about Flock and die
If you want flock to return immediately rather than wait for a lock to become free, you need a 'non-blocking' lock. eg:
flock LOCKFILE, LOCK_EX | LOCK_NB or die;A trick I learned from Dominus is to open $0 for reading and lock it rather than creating a separate file for locking.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Question about Flock and die
by pg (Canon) on Apr 05, 2003 at 20:52 UTC | |
by grantm (Parson) on Apr 05, 2003 at 21:02 UTC |