You are here

function lock_may_be_available in Memcache Storage 7

Check if lock acquired by a different process may be available.

If an existing lock has expired, it is removed.

Parameters

$name: The name of the lock.

Return value

boolean TRUE if there is no lock or it was removed, FALSE otherwise.

1 call to lock_may_be_available()
lock_wait in includes/lock.inc
Wait for a lock to be available.

File

includes/lock.inc, line 86
A memcached based implementation of a locking mechanism. See includes/lock.inc for documentation.

Code

function lock_may_be_available($name) {
  $lock_exists = MemcacheStorageAPI::get($name, 'semaphore');
  return $lock_exists ? FALSE : TRUE;
}