public function Redis_Lock_DefaultBackend::getLockId in Redis 7.3
Default implementation from actual Drupal core.
Overrides Redis_Lock_BackendInterface::getLockId
See also
Redis_Lock_BackendInterface::getLockId()
8 calls to Redis_Lock_DefaultBackend::getLockId()
- Redis_Lock_PhpRedis::lockAcquire in lib/
Redis/ Lock/ PhpRedis.php - Acquire lock.
- Redis_Lock_PhpRedis::lockMayBeAvailable in lib/
Redis/ Lock/ PhpRedis.php - Check if lock is available for acquire.
- Redis_Lock_PhpRedis::lockRelease in lib/
Redis/ Lock/ PhpRedis.php - Release given lock.
- Redis_Lock_PhpRedis::lockReleaseAll in lib/
Redis/ Lock/ PhpRedis.php - Release all locks for the given lock token identifier.
- Redis_Lock_Predis::lockAcquire in lib/
Redis/ Lock/ Predis.php - Acquire lock.
File
- lib/
Redis/ Lock/ DefaultBackend.php, line 70
Class
- Redis_Lock_DefaultBackend
- Lock backend shared methods.
Code
public function getLockId() {
if (!isset($this->_lockId)) {
$this->_lockId = uniqid(mt_rand(), TRUE);
// We only register a shutdown function if a lock is used.
drupal_register_shutdown_function('lock_release_all', $this->_lockId);
}
return $this->_lockId;
}