I'm using mysql get_lock to ensure mutual exclusion between multiple instances of php scripts that I am running for the same lines of code. I need to ensure that two simultaneous executions of the is_free_lock will not yield 0, in which case I will end up locking by both instances of the script and then execute that code twice. Please help.
if($lock->isLockFree()) {
// lock
// release lock
} else {
// trigger already locked error
}