Use flock call instead of open's flags O_EXLOCK/O_SHLOCK