if you catch the exception instead of letting the process die, youŽll have to close the file yourself to get rid of the lock. Otherwise you might block other processes in the (rather rare) case the race condition occurs.
Hey, thanks - you're absolutely right. That's one bit I had completely over looked...
Good eye!
In reply to RE: (atl: about exceptions) RE: RE: race condition? - flock and $SIG{ALRM}
by Zarathustra
in thread race condition? - flock and $SIG{ALRM}
by Zarathustra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |