flock: "it waits indefinitely until the lock is granted"
I don't know of an easy to do what you want without polling. From the looks of it though, your locks are really short lived, so it should not be a problem.
Update: s/should be/should not be/
In reply to Re^3: file reading / writing collisions
by ikegami
in thread file reading / writing collisions
by simonodell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |