You are here

function lock_release in Drupal 7

Same name and namespace in other branches
  1. 6 includes/lock.inc \lock_release()
  2. 6 includes/lock-install.inc \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

$name: The name of the lock.

Related topics

17 calls to lock_release()
DrupalCacheArray::set in includes/bootstrap.inc
Writes a value to the persistent cache immediately.
DrupalWebTestCase::storeSetupCache in modules/simpletest/drupal_web_test_case.php
Store the installation setup to a cache.
drupal_cron_run in includes/common.inc
Executes a cron run when called.
FieldInfo::getBundleExtraFields in modules/field/field.info.class.inc
Retrieves the "extra fields" for a bundle.
FieldInfo::getBundleInstances in modules/field/field.info.class.inc
Retrieves the instances for a bundle.

... See full list

File

includes/lock.inc, line 247
A database-mediated implementation of a locking mechanism.

Code

function lock_release($name) {
  global $locks;
  unset($locks[$name]);
  db_delete('semaphore')
    ->condition('name', $name)
    ->condition('value', _lock_id())
    ->execute();
}