You are here

public static function UltimateCronLockMemcache::isLocked in Ultimate Cron 7.2

Check if lock is taken.

Parameters

string $name: Name of the lock.

bool $ignore_expiration: Ignore expiration, just check if it's present. Used for retrieving the lock id of an expired lock.

Return value

mixed The lock id if found, otherwise FALSE.

2 calls to UltimateCronLockMemcache::isLocked()
UltimateCronLockMemcache::reLock in ./ultimate_cron.memcache-lock.inc
Relock.
UltimateCronLockMemcache::unlock in ./ultimate_cron.memcache-lock.inc
Release lock.

File

./ultimate_cron.memcache-lock.inc, line 174
A memcached-mediated implementation of a locking mechanism.

Class

UltimateCronLockMemcache
Class for handling lock functions.

Code

public static function isLocked($name, $ignore_expiration = FALSE) {
  $bin = variable_get('ultimate_cron_lock_memcache_bin', 'semaphore');
  $result = dmemcache_get($name, $bin);
  return $result ? $result : FALSE;
}