You are here

public static function LockMemcache::isLocked in Ultimate Cron 8.2

Check if lock is taken.

Parameters

string $name: Name of the lock.

boolean $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 LockMemcache::isLocked()
LockMemcache::reLock in src/Lock/LockMemcache.php
Relock.
LockMemcache::unlock in src/Lock/LockMemcache.php
Release lock.

File

src/Lock/LockMemcache.php, line 173

Class

LockMemcache
Class for handling lock functions.

Namespace

Drupal\ultimate_cron\Lock

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;
}