flock is probably your best bet, as it uses the CPU's specific SINGLE operation for obtaining/releasing a lock.
In reply to RE: Answer: How do I lock a file?
by chromatic
in thread How do I lock a file?
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |