function _apdqc_lock_release in Asynchronous Prefetch Database Query Cache 7
Same name in this branch
- 7 apdqc.lock.apc.inc \_apdqc_lock_release()
- 7 apdqc.lock.db.inc \_apdqc_lock_release()
- 7 apdqc.lock.memcache_storage.inc \_apdqc_lock_release()
- 7 apdqc.lock.memcache.inc \_apdqc_lock_release()
- 7 apdqc.lock.redis.inc \_apdqc_lock_release()
Release a lock previously acquired by lock_acquire().
This will release the named lock if it is still held by the current request.
Parameters
string $name: The name of the lock.
1 call to _apdqc_lock_release()
- apdqc.lock.inc in ./
apdqc.lock.inc - A database-mediated implementation of a locking mechanism.
1 string reference to '_apdqc_lock_release'
- apdqc.lock.inc in ./
apdqc.lock.inc - A database-mediated implementation of a locking mechanism.
File
- ./
apdqc.lock.memcache_storage.inc, line 153 - A memcached based implementation of a locking mechanism.
Code
function _apdqc_lock_release($name) {
global $locks;
// We unset unconditionally since caller assumes lock is released anyway.
unset($locks[$name]);
// Remove current lock from memcached pool.
$lock = MemcacheStorageAPI::get($name, 'semaphore');
if ($lock && $lock == _lock_id()) {
MemcacheStorageAPI::delete($name, 'semaphore');
}
}