doc:appunti:prog:perl_flock
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
doc:appunti:prog:perl_flock [2011/02/26 13:49] – niccolo | doc:appunti:prog:perl_flock [2011/02/26 13:56] (current) – niccolo | ||
---|---|---|---|
Line 11: | Line 11: | ||
# Try to lock the file, waiting 5 seconds max. | # Try to lock the file, waiting 5 seconds max. | ||
+ | $i = 0; | ||
while (! flock(FILE, LOCK_EX | LOCK_NB)) { | while (! flock(FILE, LOCK_EX | LOCK_NB)) { | ||
if (++$i > 5) { | if (++$i > 5) { |
doc/appunti/prog/perl_flock.txt · Last modified: 2011/02/26 13:56 by niccolo